Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return contents;
}
});
ast = applyPlugins(ast, options, plugins, 'postLoad');
ast = applyPlugins(ast, options, plugins, 'preFilters');
var filtersSet = {};
Object.keys(exports.filters).forEach(function (key) {
filtersSet[key] = exports.filters[key];
});
if (options.filters) {
Object.keys(options.filters).forEach(function (key) {
filtersSet[key] = options.filters[key];
});
}
ast = filters.handleFilters(ast, filtersSet, options.filterOptions, options.filterAliases);
ast = applyPlugins(ast, options, plugins, 'postFilters');
ast = applyPlugins(ast, options, plugins, 'preLink');
ast = link(ast);
ast = applyPlugins(ast, options, plugins, 'postLink');
// Compile
ast = applyPlugins(ast, options, plugins, 'preCodeGen');
var js = generateCode(ast, {
pretty: options.pretty,
compileDebug: options.compileDebug,
doctype: options.doctype,
inlineRuntimeFunctions: options.inlineRuntimeFunctions,
globals: options.globals,
self: options.self,
includeSources: options.includeSources ? debug_sources : false,
export default function(str) {
return filters.handleFilters(
parse(
stripComments(lex(str), {stripUnbuffered: true, stripBuffered: true}),
),
);
}