Commit 5b75572 1 parent 2c7de9d commit 5b75572 Copy full SHA for 5b75572
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ const {
46
46
assertEncoding,
47
47
stringToFlags
48
48
} = internalFS ;
49
+ const {
50
+ CHAR_FORWARD_SLASH ,
51
+ CHAR_BACKWARD_SLASH ,
52
+ } = require ( 'internal/constants' ) ;
49
53
50
54
Object . defineProperty ( exports , 'constants' , {
51
55
configurable : false ,
@@ -1569,7 +1573,7 @@ if (isWindows) {
1569
1573
} else {
1570
1574
splitRoot = function splitRoot ( str ) {
1571
1575
for ( var i = 0 ; i < str . length ; ++ i ) {
1572
- if ( str . charCodeAt ( i ) !== 47 /*'/'*/ )
1576
+ if ( str . charCodeAt ( i ) !== CHAR_FORWARD_SLASH )
1573
1577
return str . slice ( 0 , i ) ;
1574
1578
}
1575
1579
return str ;
@@ -1593,7 +1597,9 @@ if (isWindows) {
1593
1597
nextPart = function nextPart ( p , i ) {
1594
1598
for ( ; i < p . length ; ++ i ) {
1595
1599
const ch = p . charCodeAt ( i ) ;
1596
- if ( ch === 92 /*'\'*/ || ch === 47 /*'/'*/ )
1600
+
1601
+ // Check for a separator character
1602
+ if ( ch === CHAR_BACKWARD_SLASH || ch === CHAR_FORWARD_SLASH )
1597
1603
return i ;
1598
1604
}
1599
1605
return - 1 ;
You can’t perform that action at this time.
0 commit comments