MCPcopy Index your code
hub / github.com/rollup/plugins / getMatcher

Function getMatcher

packages/pluginutils/src/createFilter.ts:29–41  ·  view source on GitHub ↗
(id: string | RegExp)

Source from the content-addressed store, hash-verified

27 const resolutionBase = options && options.resolve;
28
29 const getMatcher = (id: string | RegExp) =>
30 id instanceof RegExp
31 ? id
32 : {
33 test: (what: string) => {
34 // this refactor is a tad overly verbose but makes for easy debugging
35 const pattern = getMatcherString(id, resolutionBase);
36 const fn = pm(pattern, { dot: true });
37 const result = fn(what);
38
39 return result;
40 }
41 };
42
43 const includeMatchers = ensureArray(include).map(getMatcher);
44 const excludeMatchers = ensureArray(exclude).map(getMatcher);

Callers

nothing calls this directly

Calls 2

getMatcherStringFunction · 0.85
fnFunction · 0.50

Tested by

no test coverage detected