function updateHash(): void { if (location.hash === "" || location.hash === "#" || !location.hash) { location.replace("#generator") } } window.addEventListener("hashchange", updateHash) updateHash()