MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / normalizeLoadUrl

Function normalizeLoadUrl

src/hooks/urlLoaderPolicy.ts:507–522  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

505}
506
507export function normalizeLoadUrl(url: string): UrlNormalizationResult {
508 const steps: UrlNormalizationStep[] = [];
509 let normalizedUrl = normalizeCloudStorageUrl(url);
510
511 if (normalizedUrl !== url) {
512 steps.push({ kind: 'cloud', from: url, to: normalizedUrl });
513 }
514
515 const gitNormalizedUrl = normalizeGitHostingUrl(normalizedUrl);
516 if (gitNormalizedUrl !== normalizedUrl) {
517 steps.push({ kind: 'git', from: normalizedUrl, to: gitNormalizedUrl });
518 normalizedUrl = gitNormalizedUrl;
519 }
520
521 return { url: normalizedUrl, steps };
522}
523
524export function getUrlNormalizationLogMessage(step: UrlNormalizationStep): string {
525 const label = step.kind === 'cloud' ? 'cloud' : 'Git';

Callers 2

useUrlLoaderFunction · 0.90

Calls 2

normalizeGitHostingUrlFunction · 0.90
normalizeCloudStorageUrlFunction · 0.85

Tested by

no test coverage detected