Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/glob/glob.js')
-rw-r--r--node_modules/glob/glob.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js
index f58c4bbb3..94f699340 100644
--- a/node_modules/glob/glob.js
+++ b/node_modules/glob/glob.js
@@ -200,12 +200,14 @@ Glob.prototype._finish = function () {
// at *some* point we statted all of these
all = all.map(function (m) {
var sc = this.statCache[m]
- if (!sc) return m
- if (m.slice(-1) !== "/" && (Array.isArray(sc) || sc === 2)) {
+ if (!sc)
+ return m
+ var isDir = (Array.isArray(sc) || sc === 2)
+ if (isDir && m.slice(-1) !== "/") {
return m + "/"
}
- if (m.slice(-1) === "/") {
- return m.replace(/\/$/, "")
+ if (!isDir && m.slice(-1) === "/") {
+ return m.replace(/\/+$/, "")
}
return m
}, this)