MCPcopy
hub / github.com/sveltejs/svelte / constructor

Method constructor

packages/svelte/src/reactivity/url.js:57–75  ·  view source on GitHub ↗

* @param {string | URL} url * @param {string | URL} [base]

(url, base)

Source from the content-addressed store, hash-verified

55 * @param {string | URL} [base]
56 */
57 constructor(url, base) {
58 url = new URL(url, base);
59 super(url);
60
61 if (DEV) {
62 tag(this.#protocol, 'SvelteURL.protocol');
63 tag(this.#username, 'SvelteURL.username');
64 tag(this.#password, 'SvelteURL.password');
65 tag(this.#hostname, 'SvelteURL.hostname');
66 tag(this.#port, 'SvelteURL.port');
67 tag(this.#pathname, 'SvelteURL.pathname');
68 tag(this.#hash, 'SvelteURL.hash');
69 tag(this.#search, 'SvelteURL.search');
70 }
71
72 current_url = this;
73 this.#searchParams = new SvelteURLSearchParams(url.searchParams);
74 current_url = null;
75 }
76
77 get hash() {
78 return get(this.#hash);

Callers

nothing calls this directly

Calls 1

tagFunction · 0.90

Tested by

no test coverage detected