File tree 2 files changed +1
-14
lines changed
2 files changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,4 @@ buck-out/
32
32
lib /
33
33
34
34
/.idea
35
+ coverage /
Original file line number Diff line number Diff line change 1
- import type { RegexElement } from './types' ;
2
-
3
1
/**
4
2
* Wraps regex string in a non-capturing group if it is more than one character long.
5
3
*
@@ -10,18 +8,6 @@ export function wrapGroup(regex: string): string {
10
8
return regex . length === 1 ? regex : `(?:${ regex } )` ;
11
9
}
12
10
13
- export function needsGrouping ( element : RegexElement ) {
14
- if ( typeof element === 'string' ) {
15
- return element . length > 1 ;
16
- }
17
-
18
- if ( element . type === 'characterClass' ) {
19
- return false ;
20
- }
21
-
22
- return true ;
23
- }
24
-
25
11
export function escapeText ( text : string ) {
26
12
return text . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, '\\$&' ) ; // $& means the whole matched string
27
13
}
You can’t perform that action at this time.
0 commit comments