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

Function dedupeByFile

src/eval/harness.ts:31–46  ·  view source on GitHub ↗
(results: SearchResult[])

Source from the content-addressed store, hash-verified

29}
30
31function dedupeByFile(results: SearchResult[]): SearchResult[] {
32 const seen = new Set<string>();
33 const deduped: SearchResult[] = [];
34
35 for (const result of results) {
36 const key = normalizePath(result.filePath);
37 if (seen.has(key)) {
38 continue;
39 }
40
41 seen.add(key);
42 deduped.push(result);
43 }
44
45 return deduped;
46}
47
48function getExpectedPatterns(query: EvalQuery): string[] {
49 return query.expectedPatterns ?? query.expectedTopFiles ?? [];

Callers 1

evaluateQueryFunction · 0.85

Calls 3

hasMethod · 0.80
normalizePathFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected