Comparing version 1.1.1 to 1.1.2
13
index.js
@@ -31,3 +31,3 @@ var detective = require('detective'), | ||
// For each file, mark its non-core dependencies as used | ||
return q.all(jsFiles.map(getDependencies)) | ||
return q.all(jsFiles.map(getNonCoreDependencies)) | ||
.then(function (results) { | ||
@@ -57,4 +57,4 @@ var filesUsed = {}; | ||
// Resolve with a list of dependencies for the given file | ||
function getDependencies(jsFile) { | ||
// Resolve with a list of non-core dependencies for the given file | ||
function getNonCoreDependencies(jsFile) { | ||
return getModuleType(jsFile) | ||
@@ -74,4 +74,9 @@ // Configure required options | ||
if (err) console.log(jsFile, err); | ||
deps = deps || []; | ||
deferred.resolve(deps || []); | ||
var nonCoreDeps = deps.filter(function (dep) { | ||
return ! dep.core; | ||
}); | ||
deferred.resolve(nonCoreDeps); | ||
}); | ||
@@ -78,0 +83,0 @@ |
{ | ||
"name": "app-root", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Find the entry-point/root file of any CommonJS or AMD JavaScript application", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,8 @@ var getAppRoot = require('../'); | ||
console.log(root[0].indexOf('a2.js') !== -1); | ||
}); | ||
}); | ||
getAppRoot(__dirname, options, function (root) { | ||
console.log('Entire directory Candidate roots: ', root); | ||
console.log(root.length === 2); | ||
console.log(root[0].indexOf('a2.js') !== -1 && root[1].indexOf('a2.js') !== -1); | ||
}); |
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
9405
246