Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseStyles(styles) {
const parsedStylesObj = styles.reduce((prev, curr) => {
const { content, lang } = curr;
const transpiledContent = transpileStylesContent(content, lang);
const cssAST = cssParse(transpiledContent);
return Object.assign({}, prev, parseCSS(cssAST));
}, {});
return `const ${constants.CSS} = ${JSON.stringify(parsedStylesObj)}`;
}