Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (args.length === 1 && args[0].type === acorn.tokTypes.string) {
modules.strings.push(args[0].value);
} else if (args.length === 3 // A template string without any expressions
&& args[0].type === acorn.tokTypes.backQuote
&& args[1].type === acorn.tokTypes.template
&& args[2].type === acorn.tokTypes.backQuote) {
modules.strings.push(args[1].value);
} else if (args.length > 0) {
modules.expressions.push(src.slice(args[0].start, args[args.length - 1].end));
}
if (opts.nodes) {
// Cut `src` at the end of this call, so that parseExpressionAt doesn't consider the `.abc` in
// `require('xyz').abc`
var chunk = src.slice(0, token.end);
var node = acorn.parseExpressionAt(chunk, opener.start, opts.parse);
modules.nodes.push(node);
}
state = ST_NONE;
} else {
args.push(token);
}
} else if (REQUIRE_REDEF_PATTERN[0](token)) {
state = ST_REDEF_PATTERN;
redefIndex = 1;
} else {
state = ST_NONE;
}
}
return modules;