File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ const {
4646 assertEncoding,
4747 stringToFlags
4848} = internalFS ;
49+ const {
50+ CHAR_FORWARD_SLASH ,
51+ CHAR_BACKWARD_SLASH ,
52+ } = require ( 'internal/constants' ) ;
4953
5054Object . defineProperty ( exports , 'constants' , {
5155 configurable : false ,
@@ -1814,7 +1818,7 @@ if (isWindows) {
18141818} else {
18151819 splitRoot = function splitRoot ( str ) {
18161820 for ( var i = 0 ; i < str . length ; ++ i ) {
1817- if ( str . charCodeAt ( i ) !== 47 /*'/'*/ )
1821+ if ( str . charCodeAt ( i ) !== CHAR_FORWARD_SLASH )
18181822 return str . slice ( 0 , i ) ;
18191823 }
18201824 return str ;
@@ -1838,7 +1842,9 @@ if (isWindows) {
18381842 nextPart = function nextPart ( p , i ) {
18391843 for ( ; i < p . length ; ++ i ) {
18401844 const ch = p . charCodeAt ( i ) ;
1841- if ( ch === 92 /*'\'*/ || ch === 47 /*'/'*/ )
1845+
1846+ // Check for a separator character
1847+ if ( ch === CHAR_BACKWARD_SLASH || ch === CHAR_FORWARD_SLASH )
18421848 return i ;
18431849 }
18441850 return - 1 ;
You can’t perform that action at this time.
0 commit comments