Files
zeekayandGitHub e751c17b82 Type lib under strict (#7)
Describe the live catalog, the plan ladder, the open-source read, the
Sigil maths, the tilt and the sound kit with real types. Sound is now off
until the visitor sets localStorage hz-sound to "on".

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk
2026-11-14 00:35:05 -08:00

15 lines
740 B
TypeScript

// Links to pages this site has stay inside it; sign-in and /pay are hanzo.ai's own pages; anything else is the app's
// (chat, the rooms) on hanzo.app.
import ROUTES from './routes.json';
import { APP, SIGNIN } from './app';
const HAS = new Set(ROUTES);
const SIGN = /^\/(?:login|signup|forget|join|pay)(?:\/|$)/;
const base = (p: string) => p.split(/[?#]/)[0].replace(/\/$/, '') || '/';
/** Whether this site renders `path`; anything else here (the sign-in pages, which the edge serves from the app) is a full page load. */
export const has = (path: string) => HAS.has(base(path));
export const href = (p: string) => {
if (!p || !p.startsWith('/')) return p;
if (has(p)) return p;
return (SIGN.test(base(p)) ? SIGNIN : APP) + p;
};