MCPcopy
hub / github.com/darkreader/darkreader / fixBaseURL

Function fixBaseURL

src/utils/url.ts:11–17  ·  view source on GitHub ↗
($url: string)

Source from the content-addressed store, hash-verified

9export const parsedURLCache = new Map<string, URL>();
10
11function fixBaseURL($url: string): string {
12 if (!anchor) {
13 anchor = document.createElement('a');
14 }
15 anchor.href = $url;
16 return anchor.href;
17}
18
19export function parseURL($url: string, $base: string | null = null): URL {
20 const key = `${$url}${$base ? `;${$base}` : ''}`;

Callers 1

parseURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected