MCPcopy Create free account
hub / github.com/Snapchat/Valdi / createTargetFilterForConfig

Function createTargetFilterForConfig

valdi/vscode_debugger/src/common/urlUtils.ts:399–410  ·  view source on GitHub ↗
(
  config: AnyChromiumConfiguration,
  additonalMatches: ReadonlyArray<string> = [],
)

Source from the content-addressed store, hash-verified

397 * Creates a target filter function for the given Chrome configuration.
398 */
399export 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.

Callers 3

prepareLaunchFunction · 0.90
launchBrowserMethod · 0.90
getTargetFilterMethod · 0.90

Calls 1

createTargetFilterFunction · 0.85

Tested by

no test coverage detected