MCPcopy
hub / github.com/sveltejs/kit / resolve_url

Function resolve_url

packages/kit/src/runtime/client/utils.js:12–23  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

10
11/** @param {string | URL} url */
12export function resolve_url(url) {
13 if (url instanceof URL) return url;
14
15 let baseURI = document.baseURI;
16
17 if (!baseURI) {
18 const baseTags = document.getElementsByTagName('base');
19 baseURI = baseTags.length ? baseTags[0].href : document.URL;
20 }
21
22 return new URL(url, baseURI);
23}
24
25export function scroll_state() {
26 return {

Callers 6

startFunction · 0.90
_gotoFunction · 0.90
gotoFunction · 0.90
preloadDataFunction · 0.90
pushStateFunction · 0.90
replaceStateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected