async function getJson(url: string, parse: (u: unknown) => T): Promise { const res = await fetch(url); if (!res.ok) throw new Error(`${res.status} ${res.statusText}`); return parse(await res.json()); }