File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 48
48
"@typescript-eslint/scope-manager" : " 4.27.0" ,
49
49
"debug" : " ^4.3.1" ,
50
50
"functional-red-black-tree" : " ^1.0.1" ,
51
- "lodash" : " ^4.17.21" ,
52
51
"regexpp" : " ^3.1.0" ,
53
52
"semver" : " ^7.3.5" ,
54
53
"tsutils" : " ^3.21.0"
Original file line number Diff line number Diff line change 1
1
import type { TSESLint , TSESTree } from '@typescript-eslint/experimental-utils' ;
2
- import escapeRegExp from 'lodash /escapeRegExp' ;
2
+ import { escapeRegExp } from '. /escapeRegExp' ;
3
3
4
4
// deeply re-export, for convenience
5
5
export * from '@typescript-eslint/experimental-utils/dist/ast-utils' ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Lodash <https://lodash.com/>
3
+ * Released under MIT license <https://lodash.com/license>
4
+ */
5
+ const reRegExpChar = / [ \\ ^ $ . * + ? ( ) [ \] { } | ] / g;
6
+ const reHasRegExpChar = RegExp ( reRegExpChar . source ) ;
7
+
8
+ export function escapeRegExp ( string = '' ) : string {
9
+ return string && reHasRegExpChar . test ( string )
10
+ ? string . replace ( reRegExpChar , '\\$&' )
11
+ : string ;
12
+ }
You can’t perform that action at this time.
0 commit comments