diff options
author | isaacs <i@izs.me> | 2012-10-02 23:52:16 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-10-02 23:52:28 +0400 |
commit | ef37d3ac31fe86dfc28abefdfb8547f6c2d1bb3e (patch) | |
tree | 1925445e5ca075ff43b3e8f2821ec7440844bb34 /node_modules/glob/glob.js | |
parent | 8085a1675b5c9324f1ac92e4da620f34ae11c0e9 (diff) |
glob@3.1.13
Diffstat (limited to 'node_modules/glob/glob.js')
-rw-r--r-- | node_modules/glob/glob.js | 10 |
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) |