File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
packages/metro/src/node-haste/DependencyGraph Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,24 @@ function getIgnorePattern(config: ConfigT): RegExp {
26
26
}
27
27
28
28
const combine = ( regexes : Array < RegExp > ) =>
29
- new RegExp ( regexes . map ( regex => '(' + regex . source + ')' ) . join ( '|' ) ) ;
29
+ new RegExp (
30
+ regexes
31
+ . map ( ( regex , index ) => {
32
+ if ( regex . flags !== regexes [ 0 ] . flags ) {
33
+ throw new Error (
34
+ 'Cannot combine blockList patterns, because they have different flags:\n' +
35
+ ' - Pattern 0: ' +
36
+ regexes [ 0 ] . toString ( ) +
37
+ '\n' +
38
+ ` - Pattern ${ index } : ` +
39
+ regexes [ index ] . toString ( ) ,
40
+ ) ;
41
+ }
42
+ return '(' + regex . source + ')' ;
43
+ } )
44
+ . join ( '|' ) ,
45
+ regexes [ 0 ] ?. flags ?? '' ,
46
+ ) ;
30
47
31
48
// If ignorePattern is an array, merge it into one
32
49
if ( Array . isArray ( ignorePattern ) ) {
You can’t perform that action at this time.
0 commit comments