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

Function maybeAbsolutePathToFileUrl

valdi/vscode_debugger/src/common/urlUtils.ts:357–368  ·  view source on GitHub ↗
(
  rootPath: string | undefined,
  sourceUrl: string,
)

Source from the content-addressed store, hash-verified

355}
356
357export function maybeAbsolutePathToFileUrl(
358 rootPath: string | undefined,
359 sourceUrl: string,
360): string {
361 if (
362 rootPath &&
363 platformPathToPreferredCase(sourceUrl).startsWith(rootPath) &&
364 !isValidUrl(sourceUrl)
365 )
366 return absolutePathToFileUrl(sourceUrl);
367 return sourceUrl;
368}
369
370export function urlPathToPlatformPath(p: string): string {
371 if (process.platform === 'win32') {

Callers

nothing calls this directly

Calls 4

isValidUrlFunction · 0.85
absolutePathToFileUrlFunction · 0.85
startsWithMethod · 0.80

Tested by

no test coverage detected