From c327a1dfc40b834b31c3488020859223f3583b4c Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 13 Aug 2023 15:34:18 +0530 Subject: feat: adds add-children and remove-element actions --- src/declarations.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/declarations.ts') diff --git a/src/declarations.ts b/src/declarations.ts index 6c33fda..78c9801 100644 --- a/src/declarations.ts +++ b/src/declarations.ts @@ -87,11 +87,10 @@ export const toDeclaration = (expr: Expr): Declaration | undefined => { return { selector, properties } } -export const extractDeclaration = async ( - input: string, +export const expressionsToDeclrs = async ( + exprs: Array, actions: EvalActions, -): Promise> => { - const exprs = parseDeclarations(input) +) => { const declrs = await Promise.all( exprs .map(toDeclaration) @@ -100,3 +99,11 @@ export const extractDeclaration = async ( ) return declrs.filter(declr => !!declr) as Array } + +export const extractDeclaration = async ( + input: string, + actions: EvalActions, +): Promise> => { + const exprs = parseDeclarations(input) + return expressionsToDeclrs(exprs, actions) +} -- cgit v1.3.1