MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / matchPatterns

Function matchPatterns

src/eval/discovery-harness.ts:134–144  ·  view source on GitHub ↗
(candidates: string[], patterns: string[] | undefined)

Source from the content-addressed store, hash-verified

132};
133
134function matchPatterns(candidates: string[], patterns: string[] | undefined): number | null {
135 if (!patterns || patterns.length === 0) return null;
136 const normalizedPatterns = patterns.map(normalizeText);
137 for (let index = 0; index < candidates.length; index++) {
138 const normalizedCandidate = normalizeText(candidates[index]);
139 if (normalizedPatterns.some((pattern) => normalizedCandidate.includes(pattern))) {
140 return index + 1;
141 }
142 }
143 return null;
144}
145
146export function matchSignals(
147 payload: string,

Callers 1

evaluateDiscoveryTaskFunction · 0.70

Calls 1

normalizeTextFunction · 0.70

Tested by

no test coverage detected