MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / fetchJson

Function fetchJson

src/stores/apiServer.ts:137–144  ·  view source on GitHub ↗
(url: string, options?: RequestInit)

Source from the content-addressed store, hash-verified

135 const noop = () => () => {}
136
137 async function fetchJson<T>(url: string, options?: RequestInit): Promise<T> {
138 const resp = await fetchWithAuth(url, options)
139 if (!resp.ok) {
140 const body = await resp.json().catch(() => ({}))
141 throw new Error((body as any)?.error || `HTTP ${resp.status}`)
142 }
143 return resp.json()
144 }
145
146 return {
147 getConfig: () => fetchJson('/_web/automation/config'),

Callers 1

createWebTransportFunction · 0.85

Calls 1

fetchWithAuthFunction · 0.90

Tested by

no test coverage detected