Comparing version 4.3.0 to 4.3.1
14
index.js
@@ -46,5 +46,8 @@ var acorn = require('acorn'); | ||
walk.simple(ast, { | ||
CallExpression: function (node) { | ||
if (!isRequire(node)) return; | ||
function visit(node, st, c) { | ||
var hasRequire = wordRe.test(src.slice(node.start, node.end)); | ||
if (!hasRequire) return; | ||
walk.base[node.type](node, st, c); | ||
if (node.type !== 'CallExpression') return; | ||
if (isRequire(node)) { | ||
if (node.arguments.length) { | ||
@@ -61,2 +64,7 @@ var arg = node.arguments[0]; | ||
} | ||
} | ||
walk.recursive(ast, null, { | ||
Statement: visit, | ||
Expression: visit | ||
}); | ||
@@ -63,0 +71,0 @@ |
{ | ||
"name": "detective", | ||
"description": "find all require() calls by walking the AST", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16987
402