(p: string)
| 135 | // Also resolves symlinks so that callers using the result as a cache key |
| 136 | // always get the same canonical path for a given physical directory. |
| 137 | export function resolve(p: string): string { |
| 138 | const resolved = pathResolve(windowsPath(p)) |
| 139 | try { |
| 140 | return normalizePath(realpathSync(resolved)) |
| 141 | } catch (e) { |
| 142 | if (isEnoent(e)) return normalizePath(resolved) |
| 143 | throw e |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | export function resolveFilePath(root: string, file: string): string { |
| 148 | const raw = file.startsWith("file://") ? fileURLToPath(file) : file |
no test coverage detected