(uri: string)
| 21 | * @param uri |
| 22 | */ |
| 23 | export function uriToFilePath(uri: string): string { |
| 24 | // Note: uri.path is different from uri.fsPath |
| 25 | // See |
| 26 | // https://github.com/microsoft/vscode-uri/blob/413805221cc6ed167186ab3103d3248d6f7161f2/src/index.ts#L622-L645 |
| 27 | const {scheme, fsPath} = URI.parse(uri); |
| 28 | if (scheme !== Scheme.File) { |
| 29 | return ''; |
| 30 | } |
| 31 | return fsPath; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Converts the specified `filePath` to a proper URI. |
no test coverage detected
searching dependent graphs…