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 Literal(node) {
var regex = node.regex;
if (!regex) return;
var flags = regex.flags.split("");
if (regex.flags.indexOf("u") < 0) return;
pull(flags, "u");
regex.pattern = rewritePattern(regex.pattern, regex.flags);
regex.flags = flags.join("");
}
}
if (options.rest !== false) {
ast = es6restParams.transform(ast);
}
if (options.defaultParams !== false) {
ast = es6defaultParams.transform(ast);
}
if (options.generator !== false) {
ast = regenerator.transform(ast);
}
if (options.regexpu !== false) {
ast = regexpu.transform(ast);
}
if (options.spread !== false) {
ast = es6spread.transform(ast);
}
if (options.templates !== false) {
ast = es6templates.transform(ast);
}
if (options.generator !== false && options.includeRuntime) {
var runtime = fs.readFileSync(regenerator.runtime.path, 'utf8');
injectRuntime(runtime, regenerator.runtime.path, ast.program);
}
if (options.destructuring !== false) {
RegexLiteral(node) {
if (!regex.is(node, "u")) return;
node.regex.pattern = rewritePattern(node.pattern, node.flags);
regex.pullFlag(node, "u");
}
};