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:
authorisaacs <i@izs.me>2012-10-02 23:52:16 +0400
committerisaacs <i@izs.me>2012-10-02 23:52:28 +0400
commitef37d3ac31fe86dfc28abefdfb8547f6c2d1bb3e (patch)
tree1925445e5ca075ff43b3e8f2821ec7440844bb34 /node_modules/glob/glob.js
parent8085a1675b5c9324f1ac92e4da620f34ae11c0e9 (diff)
glob@3.1.13
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)