Comparing version 0.2.1 to 0.2.2
16
index.js
@@ -56,3 +56,3 @@ var fs = require('fs'); | ||
function loadAsDirectorySync (x) { | ||
var pkgfile = x + '/package.json'; | ||
var pkgfile = path.join(x, '/package.json'); | ||
if (isFile(pkgfile)) { | ||
@@ -74,3 +74,3 @@ var body = readFileSync(pkgfile, 'utf8'); | ||
return loadAsFileSync(x + '/index'); | ||
return loadAsFileSync(path.join( x, '/index')); | ||
} | ||
@@ -82,5 +82,5 @@ | ||
var dir = dirs[i]; | ||
var m = loadAsFileSync(dir + '/' + x); | ||
var m = loadAsFileSync(path.join( dir, '/', x)); | ||
if (m) return m; | ||
var n = loadAsDirectorySync(dir + '/' + x); | ||
var n = loadAsDirectorySync(path.join( dir, '/', x )); | ||
if (n) return n; | ||
@@ -97,3 +97,9 @@ } | ||
if (parts[i] === 'node_modules') continue; | ||
var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; | ||
var dir = path.join( | ||
path.join.apply(path, parts.slice(0, i + 1)), | ||
'node_modules' | ||
); | ||
if (!parts[0].match(/([A-Za-z]:)/)) { | ||
dir = '/' + dir; | ||
} | ||
dirs.push(dir); | ||
@@ -100,0 +106,0 @@ } |
{ | ||
"name" : "resolve", | ||
"description" : "A more hookable require.resolve() implementation", | ||
"version" : "0.2.1", | ||
"version" : "0.2.2", | ||
"repository" : { | ||
@@ -6,0 +6,0 @@ "type" : "git", |
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
10983
300