File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,8 +68,7 @@ function instrumentConsole(): void {
6868 const firstArg = args [ 0 ] ;
6969 const log = originalConsoleMethods [ level ] ;
7070
71- const isFiltered =
72- _filter . size && typeof firstArg === 'string' && stringMatchesSomePattern ( firstArg , Array . from ( _filter ) ) ;
71+ const isFiltered = _filter . size && typeof firstArg === 'string' && stringMatchesSomePattern ( firstArg , _filter ) ;
7372
7473 // Only trigger handlers for non-filtered messages
7574 if ( ! isFiltered ) {
Original file line number Diff line number Diff line change @@ -136,8 +136,15 @@ export function isMatchingPattern(
136136 */
137137export function stringMatchesSomePattern (
138138 testString : string ,
139- patterns : Array < string | RegExp | ( ( value : string ) => boolean ) > = [ ] ,
139+ patterns :
140+ | Array < string | RegExp | ( ( value : string ) => boolean ) >
141+ | Set < string | RegExp | ( ( value : string ) => boolean ) > = [ ] ,
140142 requireExactStringMatch : boolean = false ,
141143) : boolean {
142- return patterns . some ( pattern => isMatchingPattern ( testString , pattern , requireExactStringMatch ) ) ;
144+ for ( const pattern of patterns ) {
145+ if ( isMatchingPattern ( testString , pattern , requireExactStringMatch ) ) {
146+ return true ;
147+ }
148+ }
149+ return false ;
143150}
You can’t perform that action at this time.
0 commit comments