This repository was archived by the owner on Aug 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ var absoluteWinRegExp = /^[A-Z]:([\\\/]|$)/i;
4
4
var absoluteNixRegExp = / ^ \/ / i;
5
5
6
6
module . exports = function join ( path , request ) {
7
- if ( request == "" ) return normalize ( path ) ;
7
+ if ( ! request ) return normalize ( path ) ;
8
8
if ( absoluteWinRegExp . test ( request ) ) return normalize ( request . replace ( / \/ / g, "\\" ) ) ;
9
9
if ( absoluteNixRegExp . test ( request ) ) return normalize ( request ) ;
10
10
if ( path == "/" ) return normalize ( path + request ) ;
11
11
if ( absoluteWinRegExp . test ( path ) ) return normalize ( path . replace ( / \/ / g, "\\" ) + "\\" + request . replace ( / \/ / g, "\\" ) ) ;
12
12
if ( absoluteNixRegExp . test ( path ) ) return normalize ( path + "/" + request ) ;
13
13
return normalize ( path + "/" + request ) ;
14
- } ;
14
+ } ;
Original file line number Diff line number Diff line change @@ -352,6 +352,8 @@ describe("join", function() {
352
352
it ( "should join paths (weird cases)" , function ( ) {
353
353
var fs = new MemoryFileSystem ( ) ;
354
354
fs . join ( "/" , "" ) . should . be . eql ( "/" ) ;
355
+ // https://github.com/webpack/memory-fs/pull/17
356
+ fs . join ( "/" , undefined ) . should . be . eql ( "/" ) ;
355
357
fs . join ( "/a/b/" , "" ) . should . be . eql ( "/a/b/" ) ;
356
358
fs . join ( "/a/b/c" , "" ) . should . be . eql ( "/a/b/c" ) ;
357
359
fs . join ( "C:" , "" ) . should . be . eql ( "C:" ) ;
You can’t perform that action at this time.
0 commit comments