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

Function normalizeRootKey

src/project-state.ts:52–63  ·  view source on GitHub ↗
(rootPath: string)

Source from the content-addressed store, hash-verified

50}
51
52export function normalizeRootKey(rootPath: string): string {
53 let normalized = path.resolve(rootPath);
54 // Strip trailing separator
55 while (normalized.length > 1 && (normalized.endsWith('/') || normalized.endsWith('\\'))) {
56 normalized = normalized.slice(0, -1);
57 }
58 // Case-insensitive on Windows
59 if (process.platform === 'win32') {
60 normalized = normalized.toLowerCase();
61 }
62 return normalized;
63}
64
65const projects = new Map<string, ProjectState>();
66

Callers 15

registerKnownRootFunction · 0.85
getKnownRootLabelFunction · 0.85
classifyProjectSourceFunction · 0.85
touchProjectFunction · 0.85
rememberProjectPathFunction · 0.85
getTrackedRootPathByKeyFunction · 0.85
forgetProjectPathFunction · 0.85
buildProjectDescriptorFunction · 0.85
listProjectDescriptorsFunction · 0.85
setActiveProjectFunction · 0.85
syncKnownRootsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected