MCPcopy
hub / github.com/web-infra-dev/rsbuild / toMatcherFn

Function toMatcherFn

e2e/helper/utils.ts:260–268  ·  view source on GitHub ↗
(matcher: FileMatcher)

Source from the content-addressed store, hash-verified

258const HASH_PATTERN = /\.[0-9a-z]{8,}(?=\.)/gi;
259
260const toMatcherFn = (matcher: FileMatcher): ((file: string) => boolean) => {
261 if (typeof matcher === 'function') {
262 return matcher;
263 }
264 if (typeof matcher === 'string') {
265 return (file: string) => file.endsWith(matcher);
266 }
267 return (file: string) => matcher.test(file);
268};
269
270/**
271 * Find the first filename that matches the matcher

Callers 1

findFileFunction · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…