File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 9
9
*/
10
10
const PREFINED_MATCH_SYNTAX_REGEXP = / ^ < ( \d + ) > $ / ;
11
11
12
+ /**
13
+ * @example C:\
14
+ */
15
+ const WINDOWS_DRIVE_LETTER_REGEXP = / ^ [ A - Z a - z ] : \\ / ;
16
+
12
17
module . exports = {
13
18
PREFINED_MATCH_SYNTAX_REGEXP ,
19
+ WINDOWS_DRIVE_LETTER_REGEXP ,
14
20
} ;
Original file line number Diff line number Diff line change 6
6
7
7
const path = require ( 'path' ) ;
8
8
const { pipe, isNotEmpty } = require ( './utility' ) ;
9
+ const { WINDOWS_DRIVE_LETTER_REGEXP } = require ( '../constants/regex' ) ;
9
10
10
11
/**
11
12
* @returns {string } filename without path
@@ -82,7 +83,7 @@ const toPosixPath = (p) => p.split(path.sep).join(path.posix.sep);
82
83
* @returns {string } file path without drive letter on windows
83
84
* @param {string } p file path on windows
84
85
*/
85
- const removeDriveLetter = ( p ) => p . replace ( / ^ [ A - Z a - z ] : \\ / , '' ) ;
86
+ const removeDriveLetter = ( p ) => p . replace ( WINDOWS_DRIVE_LETTER_REGEXP , '' ) ;
86
87
87
88
/** @typedef {module:eslint } ESLint */
88
89
/**
You can’t perform that action at this time.
0 commit comments