export function getBaseHref() { const baseEl = document.querySelector("base[href]"); if (!baseEl) { throw new Error('No element found in the DOM'); } return baseEl.getAttribute("href") ?? "/"; }