11const isWin = process . platform === 'win32' ;
2+
23/*!
34 * removeTrailingSeparator <https://github.com/darsain/remove-trailing-separator>
45 *
@@ -7,18 +8,18 @@ const isWin = process.platform === 'win32';
78 * Released under the ISC License.
89 */
910function removeTrailingSeparator ( str ) {
10- var i = str . length - 1 ;
11+ let i = str . length - 1 ;
1112 if ( i < 2 ) {
1213 return str ;
1314 }
1415 while ( isSeparator ( str , i ) ) {
1516 i -- ;
1617 }
1718 return str . substr ( 0 , i + 1 ) ;
18- } ;
19+ }
1920
2021function isSeparator ( str , i ) {
21- var char = str [ i ] ;
22+ let char = str [ i ] ;
2223 return i > 0 && ( char === '/' || ( isWin && char === '\\' ) ) ;
2324}
2425
@@ -38,7 +39,7 @@ function normalizePath(str, stripTrailing) {
3839 str = removeTrailingSeparator ( str ) ;
3940 }
4041 return str ;
41- } ;
42+ }
4243
4344/*!
4445 * unixify <https://github.com/jonschlinkert/unixify>
@@ -53,11 +54,11 @@ export function unixify(filepath, stripTrailing = true) {
5354 return filepath . replace ( / ^ ( [ a - z A - Z ] + : | \. \/ ) / , '' ) ;
5455 }
5556 return filepath ;
56- } ;
57+ }
5758
5859/*
5960* Corrects a windows path to unix format (including \\?\c:...)
6061*/
6162export function correctPath ( filepath ) {
62- return unixify ( filepath . replace ( / ^ \\ \\ \? \\ .: \\ / , '\\' ) ) ;
63+ return unixify ( filepath . replace ( / ^ \\ \\ \? \\ .: \\ / , '\\' ) ) ;
6364}
0 commit comments