Comparing version 0.0.2 to 0.0.3
16
index.js
@@ -43,2 +43,18 @@ var burrito = require('burrito'); | ||
} | ||
var isDotCallRequire = node.name === 'call' | ||
&& node.value[0][0] === 'dot' | ||
&& node.value[0][1][0] === 'call' | ||
&& node.value[0][1][1][0] === 'name' | ||
&& node.value[0][1][1][1] === 'require' | ||
; | ||
if (isDotCallRequire) { | ||
var expr = node.value[0][1][2][0]; | ||
if (expr[0].name === 'string') { | ||
modules.strings.push(expr[1]); | ||
} | ||
else { | ||
modules.expressions.push(burrito.deparse(expr)); | ||
} | ||
} | ||
}); | ||
@@ -45,0 +61,0 @@ |
{ | ||
"name" : "detective", | ||
"description" : "Find all calls to require() no matter how crazily nested using a proper walk of the AST", | ||
"version" : "0.0.2", | ||
"version" : "0.0.3", | ||
"repository" : { | ||
@@ -6,0 +6,0 @@ "type" : "git", |
@@ -12,1 +12,3 @@ var a = require('a'); | ||
var y = require('y') * 100; | ||
var EventEmitter2 = require('events2').EventEmitter(); |
@@ -7,3 +7,3 @@ var assert = require('assert'); | ||
exports.single = function () { | ||
assert.deepEqual(detective(src), [ 'a', 'b', 'c', 'events', 'doom', 'y' ]); | ||
assert.deepEqual(detective(src), [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ]); | ||
}; |
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
14460
328