* Determines the relative path between two paths. If either path is a `file:` URL, * it is converted to a local path.
(path: string, relativeTo: string)
| 216 | * it is converted to a local path. |
| 217 | */ |
| 218 | relativePath(path: string, relativeTo: string): string { |
| 219 | if (!path) { |
| 220 | return path; |
| 221 | } |
| 222 | |
| 223 | path = this.normalizePath(path); |
| 224 | |
| 225 | if (path.startsWith('.')) { |
| 226 | return path; |
| 227 | } |
| 228 | |
| 229 | path = relative(this.normalizePath(relativeTo), path); |
| 230 | |
| 231 | return this.normalizePath(path); |
| 232 | }, |
| 233 | |
| 234 | /** |
| 235 | * Computes the absolute path to for the given path relative to the provided base directory. |
nothing calls this directly
no test coverage detected