MCPcopy Index your code
hub / github.com/upstash/jstack / parseJsonResponse

Function parseJsonResponse

packages/jstack/src/server/client.ts:194–204  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

192// }
193
194const parseJsonResponse = async (response: Response): Promise<any> => {
195 const text = await response.text()
196 const isSuperjson = response.headers.get("x-is-superjson") === "true"
197
198 try {
199 return isSuperjson ? superjson.parse(text) : JSON.parse(text)
200 } catch (error) {
201 console.error("Failed to parse response as JSON:", error)
202 throw new Error("Invalid JSON response")
203 }
204}
205
206function serializeWithSuperJSON(data: any): any {
207 if (typeof data !== "object" || data === null) {

Callers 1

jfetchFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected