(projectRoot: string)
| 330 | * `\\?\`-prefixed native result diverging from a plain one. |
| 331 | */ |
| 332 | export 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 |
no test coverage detected