File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ const ONE_DOT = '.';
7676const TWO_DOTS = '..' ;
7777const STRING_TYPE = 'string' ;
7878const BACK_SLASH_RE = / \\ / g;
79- const DOUBLE_SLASH_RE = / \/ \/ / ;
79+ const DOUBLE_SLASH_RE = / \/ \/ / g ;
8080const DOT_RE = / \. .* \. ( s w [ p x ] ) $ | ~ $ | \. s u b l .* \. t m p / ;
8181const REPLACER_RE = / ^ \. [ / \\ ] / ;
8282
@@ -113,8 +113,7 @@ function normalizePath(path: Path): Path {
113113 path = path . replace ( / \\ / g, '/' ) ;
114114 let prepend = false ;
115115 if ( path . startsWith ( '//' ) ) prepend = true ;
116- const DOUBLE_SLASH_RE = / \/ \/ / ;
117- while ( path . match ( DOUBLE_SLASH_RE ) ) path = path . replace ( DOUBLE_SLASH_RE , '/' ) ;
116+ path = path . replace ( DOUBLE_SLASH_RE , '/' ) ;
118117 if ( prepend ) path = '/' + path ;
119118 return path ;
120119}
@@ -168,9 +167,7 @@ const toUnix = (string: string) => {
168167 if ( str . startsWith ( SLASH_SLASH ) ) {
169168 prepend = true ;
170169 }
171- while ( str . match ( DOUBLE_SLASH_RE ) ) {
172- str = str . replace ( DOUBLE_SLASH_RE , SLASH ) ;
173- }
170+ str = str . replace ( DOUBLE_SLASH_RE , SLASH ) ;
174171 if ( prepend ) {
175172 str = SLASH + str ;
176173 }
You can’t perform that action at this time.
0 commit comments