(name: string)
| 36 | * `realpathSync` alone cannot do it: the path often does not exist yet (it is about to be |
| 37 | * created). So resolve the longest prefix that does exist and rebuild the rest onto it. |
| 38 | */ |
| 39 | export function canonicalPath(p: string): string { |
| 40 | try { |
| 41 | return realpathSync(p); |
| 42 | } catch { |
| 43 | const parent = path.dirname(p); |
| 44 | // At the filesystem root `dirname` is a fixed point; stop rather than recurse forever. |
no test coverage detected