( config: AnyChromiumConfiguration, additonalMatches: ReadonlyArray<string> = [], )
| 397 | * Creates a target filter function for the given Chrome configuration. |
| 398 | */ |
| 399 | export const createTargetFilterForConfig = ( |
| 400 | config: AnyChromiumConfiguration, |
| 401 | additonalMatches: ReadonlyArray<string> = [], |
| 402 | ): ((t: { url: string }) => boolean) => { |
| 403 | const filter = config.urlFilter || config.url || ('file' in config && config.file); |
| 404 | if (!filter) { |
| 405 | return () => true; |
| 406 | } |
| 407 | |
| 408 | const tester = createTargetFilter(filter, ...additonalMatches); |
| 409 | return t => tester(t.url); |
| 410 | }; |
| 411 | |
| 412 | /** |
| 413 | * Creates a function to filter a target URL. |
no test coverage detected