MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / getTopExports

Function getTopExports

src/tools/search-codebase.ts:607–616  ·  view source on GitHub ↗
(filePath: string, maxCount = 3)

Source from the content-addressed store, hash-verified

605
606 // Get up to maxCount named exports for a file from relationships.graph.exports
607 function getTopExports(filePath: string, maxCount = 3): string[] {
608 if (!relationships?.graph?.exports) return [];
609 const normalized = normalizeGraphPath(filePath);
610 const fileExports = relationships.graph.exports[normalized];
611 if (!Array.isArray(fileExports)) return [];
612 return fileExports
613 .filter((e) => e.name !== 'default')
614 .slice(0, maxCount)
615 .map((e) => e.name);
616 }
617
618 // Filter memories to only strongly relevant ones for compact mode:
619 // ≥2 non-stop-word query term matches AND effectiveConfidence ≥ 0.5

Callers 1

handleFunction · 0.85

Calls 1

normalizeGraphPathFunction · 0.85

Tested by

no test coverage detected