Comparing version 0.0.4 to 0.1.0
12
index.js
@@ -18,2 +18,6 @@ var fs = require('fs'); | ||
if (!opts) opts = {}; | ||
var isFile = opts.isFile || function (file) { | ||
return path.existsSync(file) && fs.statSync(file).isFile() | ||
}; | ||
var readFileSync = opts.readFileSync || fs.readFileSync; | ||
@@ -37,3 +41,3 @@ var extensions = opts.extensions || [ '.js' ]; | ||
function loadAsFileSync (x) { | ||
if (path.existsSync(x) && fs.statSync(x).isFile()) { | ||
if (isFile(x)) { | ||
return x; | ||
@@ -44,3 +48,3 @@ } | ||
var file = x + extensions[i]; | ||
if (path.existsSync(file) && fs.statSync(file).isFile()) { | ||
if (isFile(file)) { | ||
return file; | ||
@@ -53,4 +57,4 @@ } | ||
var pkgfile = x + '/package.json'; | ||
if (path.existsSync(pkgfile) && fs.statSync(pkgfile).isFile()) { | ||
var body = fs.readFileSync(pkgfile, 'utf8'); | ||
if (isFile(pkgfile)) { | ||
var body = readFileSync(pkgfile, 'utf8'); | ||
try { | ||
@@ -57,0 +61,0 @@ var pkg = JSON.parse(body); |
{ | ||
"name" : "resolve", | ||
"description" : "A more hookable require.resolve() implementation", | ||
"version" : "0.0.4", | ||
"version" : "0.1.0", | ||
"repository" : { | ||
@@ -6,0 +6,0 @@ "type" : "git", |
Sorry, the diff of this file is not supported yet
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
9572
17
255
46