| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dc8c079 commit 65037ee
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,6 +14,10 @@ exports.normalizeArray = function (parts, keepBlanks) { | |||
| 14 | 14 | // if it's a dot, and there was some previous dir already, then skip it. | |
| 15 | 15 | if (directory === "." && prev !== undefined) continue; | |
| 16 | 16 | ||
| 17 | + // if it starts with "", and is a . or .., then skip it. | ||
| 18 | + if (directories.length === 1 && directories[0] === "" && ( | ||
| 19 | + directory === "." || directory === "..")) continue; | ||
| 20 | + | ||
| 17 | 21 | if ( | |
| 18 | 22 | directory === ".." | |
| 19 | 23 | && directories.length | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,9 +38,11 @@ assert.equal(path.extname("file.ext.ext"), ".ext"); | |||
| 38 | 38 | assert.equal(path.extname("file."), "."); | |
| 39 | 39 | ||
| 40 | 40 | assert.equal(path.join(".", "fixtures/b", "..", "/b/c.js"), "fixtures/b/c.js"); | |
| 41 | + assert.equal(path.join("/foo", "../../../bar"), "/bar"); | ||
| 41 | 42 | ||
| 42 | 43 | assert.equal(path.normalize("./fixtures///b/../b/c.js"), "fixtures/b/c.js"); | |
| 43 | 44 | assert.equal(path.normalize("./fixtures///b/../b/c.js",true), "fixtures///b/c.js"); | |
| 45 | + assert.equal(path.normalize("/foo/../../../bar"), "/bar"); | ||
| 44 | 46 | ||
| 45 | 47 | assert.deepEqual(path.normalizeArray(["fixtures","b","","..","b","c.js"]), ["fixtures","b","c.js"]); | |
| 46 | 48 | assert.deepEqual(path.normalizeArray(["fixtures","","b","..","b","c.js"], true), ["fixtures","","b","c.js"]); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments