Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function parseDeclarations(data) {
const ast = parse(data);
const $ast = createQueryWrapper(ast);
const implicitGlobalDeclarations = $ast('declaration').hasParent('stylesheet');
const explicitGlobalDeclarations = $ast('declaration').hasParent('block')
.filter(node => isExplicitGlobalDeclaration($ast, node));
let implicitGlobals = implicitGlobalDeclarations.map(declaration => parseDeclaration($ast, declaration, SCOPE_IMPICIT));
let explicitGlobals = explicitGlobalDeclarations.map(declaration => parseDeclaration($ast, declaration, SCOPE_EXPLICIT));
return { explicitGlobals, implicitGlobals };
}