UNPKG

@virtualstate/navigation

Version:

Native JavaScript [navigation](https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API) implementation

15 lines 427 B
function getWindowBaseURL() { try { if (typeof window !== "undefined" && window.location) { return window.location.href; } } catch { } } export function getBaseURL(url) { const baseURL = getWindowBaseURL() ?? "https://html.spec.whatwg.org/"; return new URL( // Deno wants this to be always a string (url ?? "").toString(), baseURL); } //# sourceMappingURL=base-url.js.map