detect-import-require
Advanced tools
Comparing version 1.0.2 to 1.0.3
20
index.js
@@ -19,7 +19,7 @@ var acorn = require('acorn') | ||
opts = opts || {} | ||
src = str.toString() | ||
src = src.toString() | ||
var imports = defined(opts.imports, true) | ||
var requires = defined(opts.requires, true) | ||
var results = { | ||
@@ -30,3 +30,3 @@ strings: [], | ||
} | ||
// quick regex test before we parse entire AST | ||
@@ -39,3 +39,3 @@ var regex = regexBoth | ||
} | ||
var ast = acorn.parse(src, { | ||
@@ -55,6 +55,6 @@ ecmaVersion: 6, | ||
} | ||
results.nodes.push(node); | ||
results.nodes.push(node) | ||
} | ||
} | ||
if (requires) { | ||
@@ -70,3 +70,3 @@ callExpression = function (node) { | ||
} | ||
results.nodes.push(node); | ||
results.nodes.push(node) | ||
} | ||
@@ -84,4 +84,4 @@ } | ||
function isRequire (node) { | ||
return node.callee.type === 'Identifier' | ||
&& node.callee.name === 'require' | ||
return node.callee.type === 'Identifier' && | ||
node.callee.name === 'require' | ||
} |
{ | ||
"name": "detect-import-require", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "list require and import paths from a JavaScript source", | ||
@@ -12,2 +12,7 @@ "main": "index.js", | ||
}, | ||
"standard": { | ||
"ignore": [ | ||
"test/fixtures/**/*.js" | ||
] | ||
}, | ||
"dependencies": { | ||
@@ -14,0 +19,0 @@ "acorn": "^2.6.4", |
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
6181