Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// pre process
if (transformer.preprocess) {
content = transformer.preprocess(content, filePath, config, stylePart.attrs)
}
// transform
if (transformer.process) {
content = transformer.process(content, filePath, config, stylePart.attrs)
} else {
const preprocessOptions = getPreprocessOptions(
stylePart.lang,
filePath,
config
)
const result = compileStyle({
source: content,
filePath,
preprocessLang: stylePart.lang,
preprocessOptions,
scoped: false
})
logResultErrors(result)
content = result.code
}
// post process
if (transformer.postprocess) {
return transformer.postprocess(content, filePath, config, stylePart.attrs)
}
return JSON.stringify(extractClassMap(content))