(url: string)
| 1 | export async function fetchGetJSON(url: string) { |
| 2 | try { |
| 3 | const data = await fetch(url).then((res) => res.json()); |
| 4 | return data; |
| 5 | } catch (err) { |
| 6 | if (err instanceof Error) { |
| 7 | throw new Error(err.message); |
| 8 | } |
| 9 | throw err; |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | export async function fetchPostJSON(url: string, data?: {}) { |
| 14 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected