detective-cjs
Advanced tools
Comparing version 3.1.1 to 3.1.2
12
index.js
@@ -12,9 +12,6 @@ 'use strict'; | ||
const walker = new Walker(); | ||
const dependencies = []; | ||
walker.walk(content, function(node) { | ||
if (!types.isRequire(node) || | ||
!node.arguments || | ||
!node.arguments.length) { | ||
walker.walk(content, (node) => { | ||
if (!types.isRequire(node) || !node.arguments || node.arguments.length === 0) { | ||
return; | ||
@@ -31,3 +28,2 @@ } | ||
} | ||
}); | ||
@@ -41,3 +37,5 @@ | ||
return node.arguments[0].value; | ||
} else if (node.arguments[0].type === 'TemplateLiteral') { | ||
} | ||
if (node.arguments[0].type === 'TemplateLiteral') { | ||
return node.arguments[0].quasis[0].value.raw; | ||
@@ -44,0 +42,0 @@ } |
{ | ||
"name": "detective-cjs", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Get the dependencies of a CommonJS module by traversing its AST", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"test": "jscs index.js test && mocha test/test.js" | ||
"lint": "eslint index.js \"test/*.js\"", | ||
"mocha": "mocha", | ||
"test": "npm run lint && npm run mocha" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mrjoelkemp/node-detective-cjs.git" | ||
"url": "https://github.com/dependents/node-detective-cjs.git" | ||
}, | ||
@@ -25,18 +30,16 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/mrjoelkemp/node-detective-cjs/issues" | ||
"url": "https://github.com/dependents/node-detective-cjs/issues" | ||
}, | ||
"homepage": "https://github.com/mrjoelkemp/node-detective-cjs", | ||
"homepage": "https://github.com/dependents/node-detective-cjs", | ||
"engines": { | ||
"node": ">= 6.0" | ||
"node": ">=6.0" | ||
}, | ||
"devDependencies": { | ||
"jscs": "^3.0.7", | ||
"jscs-preset-mrjoelkemp": "~2.0.0", | ||
"mocha": "^5.2.0", | ||
"sinon": "^6.1.5" | ||
}, | ||
"dependencies": { | ||
"ast-module-types": "^2.4.0", | ||
"node-source-walk": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.16.0", | ||
"mocha": "^6.2.3" | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
4266
2
4
28
36
1