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

Function normalizeHealthLookupKey

src/health/store.ts:104–114  ·  view source on GitHub ↗
(filePath: string, rootPath?: string)

Source from the content-addressed store, hash-verified

102}
103
104export function normalizeHealthLookupKey(filePath: string, rootPath?: string): string {
105 const normalized = filePath.replace(/\\/g, '/').replace(/^\.\//, '');
106 if (!rootPath) {
107 return normalized;
108 }
109 const normalizedRoot = rootPath.replace(/\\/g, '/').replace(/\/$/, '');
110 if (normalized.startsWith(normalizedRoot)) {
111 return normalized.slice(normalizedRoot.length).replace(/^\//, '');
112 }
113 return normalized;
114}
115
116export function indexHealthByFile(
117 artifact: CodebaseHealthArtifact | null,

Callers 4

handleFunction · 0.85
getResultHealthFunction · 0.85
summarizeResultHealthFunction · 0.85
indexHealthByFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected