MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / canonicalProjectRoot

Function canonicalProjectRoot

src/directory.ts:332–342  ·  view source on GitHub ↗
(projectRoot: string)

Source from the content-addressed store, hash-verified

330 * `\\?\`-prefixed native result diverging from a plain one.
331 */
332export function canonicalProjectRoot(projectRoot: string): string {
333 const resolved = path.resolve(projectRoot);
334 let canonical = resolved;
335 try {
336 canonical = fs.realpathSync.native(resolved);
337 } catch {
338 // ENOENT/EACCES/ELOOP — the root is normally there (`.codegraph/` lives in
339 // it), so this is a fallback rather than a path we expect to take.
340 }
341 return process.platform === 'win32' ? canonical.toLowerCase() : canonical;
342}
343
344/**
345 * Whether two resolved index roots are one index spelled two ways — a symlinked

Callers 6

claimMethod · 0.90
projectHashFunction · 0.90
recordPathFunction · 0.90
stopDaemonAtFunction · 0.90
acquireProjectFunction · 0.90

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected