(path: string)
| 6 | |
| 7 | // Converts a local path to a file:/// URI |
| 8 | export function localPathToUri(path: string) { |
| 9 | // This may incidentally solve bugs, but it is primarily here to warn us if we accidentally try to double-convert. It doesn't handle other URI schemes. |
| 10 | if (path.startsWith("file://")) { |
| 11 | console.warn("localPathToUri: path already starts with file://"); |
| 12 | return path; |
| 13 | } |
| 14 | const url = pathToFileURL(path); |
| 15 | return URI.normalize(url.toString()); |
| 16 | } |
| 17 | |
| 18 | export function localPathOrUriToPath(localPathOrUri: string): string { |
| 19 | try { |
no test coverage detected