enhanced-resolve
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -61,3 +61,5 @@ /* | ||
if(data) { | ||
return callback.apply(null, data); | ||
return process.nextTick(function() { | ||
callback.apply(null, data); | ||
}); | ||
} | ||
@@ -85,3 +87,3 @@ } | ||
} catch(e) { | ||
this.finishedSync(null, e); | ||
this.finishedSync(name, e); | ||
throw e; | ||
@@ -88,0 +90,0 @@ } |
@@ -16,20 +16,29 @@ /* | ||
module.exports = function getPaths(path) { | ||
var parts = path.split(/(.*?[\\\/]+)/); | ||
var paths = [path]; | ||
var pathSeqments = []; | ||
var addr = [path]; | ||
var pathSeqment = popPathSeqment(addr); | ||
while(pathSeqment) { | ||
pathSeqments.push(pathSeqment); | ||
paths.push(addr[0]); | ||
pathSeqment = popPathSeqment(addr); | ||
var seqments = [parts[parts.length - 1]]; | ||
var part = parts[parts.length - 1]; | ||
path = path.substr(0, path.length - part.length - 1); | ||
paths.push(path) | ||
for(var i = parts.length - 2; i > 2; i-=2) { | ||
var part = parts[i]; | ||
path = path.substr(0, path.length - part.length) || "/"; | ||
paths.push(path); | ||
seqments.push(part.substr(0, part.length - 1)); | ||
} | ||
pathSeqments.push(paths[paths.length - 1]); | ||
part = parts[1]; | ||
seqments.push(part.length > 1 ? part.substr(0, part.length - 1) : part); | ||
return { | ||
paths: paths, | ||
seqments: pathSeqments | ||
}; | ||
}; | ||
seqments: seqments | ||
} | ||
} | ||
module.exports.basename = function basename(path) { | ||
return popPathSeqment([path]); | ||
var i = path.lastIndexOf("/"), | ||
j = path.lastIndexOf("\\"); | ||
var p = i < 0 ? j : j < 0 ? i : i < j ? j : i; | ||
if(p < 0) return null; | ||
var s = path.substr(p + 1); | ||
return s; | ||
} |
{ | ||
"name": "enhanced-resolve", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Offers a async require.resolve function. It's highly configurable.", |
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
77487
2197