Comparing version 0.1.0 to 0.1.2
@@ -27,4 +27,6 @@ var fs = require('fs'); | ||
; | ||
if (x.match(/^(?:\.\.?\/|\/)/)) { | ||
opts.paths = opts.paths || []; | ||
if (x.match(/^(?:\.\.?\/|\/|([A-Za-z]:)?\\)/)) { | ||
var m = loadAsFileSync(path.resolve(y, x)) | ||
@@ -94,4 +96,4 @@ || loadAsDirectorySync(path.resolve(y, x)); | ||
} | ||
return dirs; | ||
return opts.paths.concat(dirs); | ||
} | ||
}; |
{ | ||
"name" : "resolve", | ||
"description" : "A more hookable require.resolve() implementation", | ||
"version" : "0.1.0", | ||
"version" : "0.1.2", | ||
"repository" : { | ||
@@ -6,0 +6,0 @@ "type" : "git", |
@@ -117,1 +117,33 @@ var assert = require('assert'); | ||
}; | ||
exports.other_path = function () { | ||
var resolverDir = __dirname + '/resolver'; | ||
var dir = resolverDir + '/bar'; | ||
var otherDir = resolverDir + '/other_path'; | ||
var path = require('path'); | ||
assert.equal( | ||
resolve.sync('root', { | ||
basedir : dir, | ||
paths: [otherDir] }), | ||
resolverDir + '/other_path/root.js' | ||
); | ||
assert.equal( | ||
resolve.sync('lib/other-lib', { | ||
basedir : dir, | ||
paths: [otherDir] }), | ||
resolverDir + '/other_path/lib/other-lib.js' | ||
); | ||
assert.throws(function () { | ||
resolve.sync('root', { basedir : dir, }); | ||
}); | ||
assert.throws(function () { | ||
resolve.sync('zzz', { | ||
basedir : dir, | ||
paths: [otherDir] }); | ||
}); | ||
}; |
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
10418
19
282
0
1