File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/middleware-code-coverage/lib Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,14 @@ async function excludePatterns(resources) {
178
178
if ( sPattern . endsWith ( "**" ) ) {
179
179
sPattern = sPattern + "/*" ;
180
180
}
181
+
181
182
// quote characters that might have been used but have a special meaning in regular expressions
182
- // TODO: clarify is this regex is valid
183
- // eslint-disable-next-line no-useless-escape
184
- sPattern = sPattern . replace ( / [ \[ \] \( \) \. ] / g, "\\$&" ) ;
183
+ sPattern = sPattern
184
+ . replaceAll ( "[" , "\\[" )
185
+ . replaceAll ( "]" , "\\]" )
186
+ . replaceAll ( "(" , "\\(" )
187
+ . replaceAll ( ")" , "\\)" )
188
+ . replaceAll ( "." , "\\." ) ;
185
189
// our wildcard '*' means 'any name segment, but not multiple components'
186
190
sPattern = sPattern . replace ( / \* / g, "[^/]*" ) ;
187
191
// our wildcard '**/' means 'any number of name segments'
You can’t perform that action at this time.
0 commit comments