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

Function normalizePathKey

src/utils/project-discovery.ts:50–56  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

48]);
49
50function normalizePathKey(filePath: string): string {
51 let normalized = path.resolve(filePath);
52 while (normalized.length > 1 && (normalized.endsWith('/') || normalized.endsWith('\\'))) {
53 normalized = normalized.slice(0, -1);
54 }
55 return process.platform === 'win32' ? normalized.toLowerCase() : normalized;
56}
57
58export function isPathWithin(basePath: string, candidatePath: string): boolean {
59 const resolvedBasePath = path.resolve(basePath);

Callers 2

walkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected