| 233 | * Converts a file URL to a windows network path, if possible. |
| 234 | */ |
| 235 | export function fileUrlToNetworkPath(urlOrPath: string): string { |
| 236 | if (isFileUrl(urlOrPath)) { |
| 237 | urlOrPath = urlOrPath.replace('file:///', '\\\\'); |
| 238 | urlOrPath = urlOrPath.replace(/\//g, '\\'); |
| 239 | urlOrPath = decodeURIComponent(urlOrPath); |
| 240 | } |
| 241 | |
| 242 | return urlOrPath; |
| 243 | } |
| 244 | |
| 245 | // TODO: this does not escape/unescape special characters, but it should. |
| 246 | export function absolutePathToFileUrl(absolutePath: string): string { |