MCPcopy Index your code
hub / github.com/microsoft/vscode-js-debug / platformPathToUrlPath

Function platformPathToUrlPath

src/common/urlUtils.ts:515–529  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

513}
514
515export function platformPathToUrlPath(p: string): string {
516 p = platformPathToPreferredCase(p);
517
518 if (platform === 'win32') {
519 if (isUncPath(p)) {
520 p = p.slice(1); // emit "file:////" and not "file://///" to match what V8 expects
521 }
522 return p
523 .split(/[\\//]/g)
524 .map((p, i) => (i > 0 ? encodeURIComponent(p) : p))
525 .join('/');
526 } else {
527 return p.split('/').map(encodeURIComponent).join('/');
528 }
529}
530
531export function platformPathToPreferredCase(p: string): string;
532export function platformPathToPreferredCase(p: string | undefined): string | undefined;

Callers 2

absolutePathToFileUrlFunction · 0.85

Calls 3

isUncPathFunction · 0.90
mapMethod · 0.80

Tested by

no test coverage detected