import type { Fetch } from "#lib/fetch.ts"; export const fetchJson = async ( fetch: Fetch, url: string, timeout: number ): Promise => { try { const res = await fetch(url, { signal: AbortSignal.timeout(timeout) }); if (!res.ok) return null; return (await res.json()) as T; } catch { return null; } };