MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / constructor

Method constructor

modules/data/url/url.js:42–48  ·  view source on GitHub ↗
(href, base)

Source from the content-addressed store, hash-verified

40 #parts;
41 #searchParams;
42 constructor(href, base) {
43 if (base !== undefined)
44 this.#parts = parseURL(href, parseURL(base));
45 else
46 this.#parts = parseURL(href);
47 this.#searchParams = new URLSearchParams(this.#parts.query, this.#parts);
48 }
49 get hash() {
50 return serializeURL(this.#parts, FRAGMENT);
51 }

Callers

nothing calls this directly

Calls 1

parseURLFunction · 0.85

Tested by

no test coverage detected