MCPcopy Create free account
hub / github.com/Tong89/smartNode / makeResponse

Function makeResponse

frontend/src/api/client.test.ts:20–31  ·  view source on GitHub ↗

Build a minimal Response-like object for fetch mocks.

(
  body: unknown,
  status = 200,
  contentType = 'application/json',
)

Source from the content-addressed store, hash-verified

18
19/** Build a minimal Response-like object for fetch mocks. */
20function makeResponse(
21 body: unknown,
22 status = 200,
23 contentType = 'application/json',
24): Response {
25 const bodyText =
26 typeof body === 'string' ? body : JSON.stringify(body);
27 return new Response(bodyText, {
28 status,
29 headers: { 'Content-Type': contentType },
30 });
31}
32
33// ── resolveApiBase ────────────────────────────────────────────────────────────
34

Callers 1

client.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected