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 converter(result, options = {
quote: `'`,
conver: 'sass',
autoprefixer: true
}, globalVariableList = []) {
if (options.isSignComment) result = result.replace(/\/\/\s(.*)/g, '/* !#sign#! $1 */')
// Add semicolons to properties with inline comments to ensure that they are parsed correctly
result = result.replace(/^( *)(\S(.+?))( *)(\/\*.*\*\/)$/gm, '$1$2;$4$5');
if (typeof result !== 'string') return result
const ast = new Parser(result).parse()
// 开发时查看 ast 对象。
console.log(JSON.stringify(ast))
const text = visitor(ast, options, globalVariableList)
// Convert special multiline comments to single-line comments
return text.replace(/\/\*\s!#sign#!\s(.*)\s\*\//g, '// $1')
}
export function parse(result) {
return new Parser(result).parse()
}