MCPcopy Create free account
hub / github.com/Snapchat/Valdi / fileUrlToNetworkPath

Function fileUrlToNetworkPath

valdi/vscode_debugger/src/common/urlUtils.ts:235–243  ·  view source on GitHub ↗
(urlOrPath: string)

Source from the content-addressed store, hash-verified

233 * Converts a file URL to a windows network path, if possible.
234 */
235export 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.
246export function absolutePathToFileUrl(absolutePath: string): string {

Callers

nothing calls this directly

Calls 2

isFileUrlFunction · 0.85
replaceMethod · 0.65

Tested by

no test coverage detected