MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / fetchGetJSON

Function fetchGetJSON

src/utils/api-helpers.ts:1–11  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

1export 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
13export async function fetchPostJSON(url: string, data?: {}) {
14 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected