Skip to content

Commit

Permalink
feat: add UNC paths to the join absoluteWinRegexp regex
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 17, 2016
1 parent a66aa97 commit 3ccfa79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/join.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var normalize = require("./normalize");

var absoluteWinRegExp = /^[A-Z]:([\\\/]|$)/i;
var absoluteWinRegExp = /^(?:[A-Z]:([\\\/]|$))|(\\\\)/i;
var absoluteNixRegExp = /^\//i;

module.exports = function join(path, request) {
Expand Down
1 change: 1 addition & 0 deletions test/MemoryFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ describe("join", function() {
fs.join("C:\\", "a\\b").should.be.eql("C:\\a\\b");
fs.join("C:/a/b", "./../c/d").should.be.eql("C:\\a\\c\\d");
fs.join("C:\\a\\b", "./../c/d").should.be.eql("C:\\a\\c\\d");
fs.join("\\\\a\\b\\..\\c\\d\\..").should.be.eql("\\\\a\\c");
});
it("should join paths (weird cases)", function() {
var fs = new MemoryFileSystem();
Expand Down

0 comments on commit 3ccfa79

Please sign in to comment.