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

Function canonicalProjectRoot

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

Source from the content-addressed store, hash-verified

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