export function fetchJSON(url: string): Promise { return fetch(url) .then((response) => { if (!response.ok) throw new Error(`Error fetching ${url}: ${response.status} - ${response.statusText}`); return response.json(); }); }