MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / jsonResponse

Function jsonResponse

packages/core/api/src/update-check.test.ts:20–24  ·  view source on GitHub ↗
(body: unknown, ok = true)

Source from the content-addressed store, hash-verified

18} from "./update-check";
19
20const jsonResponse = (body: unknown, ok = true): Response =>
21 new Response(JSON.stringify(body), {
22 status: ok ? 200 : 500,
23 headers: { "content-type": "application/json" },
24 });
25
26const fetchReturning = (body: unknown, ok = true): typeof fetch =>
27 (async () => jsonResponse(body, ok)) as typeof fetch;

Callers 1

fetchReturningFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected