export const normalizeUrl = (input: string) => { const url = new URL(input, window.location.origin); url.pathname = url.pathname.replace(/\/{2,}/g, '/'); return url.toString(); };