(filePath: string)
| 15 | * Resolves a path through symlinks, falling back to the original path on miss. |
| 16 | */ |
| 17 | export async function getCanonicalPath(filePath: string): Promise<string> { |
| 18 | try { |
| 19 | return await realpath(filePath); |
| 20 | } catch { |
| 21 | return filePath; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Returns the inclusive directory chain from `parent` to `child`. |