MCPcopy
hub / github.com/CopilotKit/CopilotKit / jsonResponse

Function jsonResponse

packages/angular/src/lib/threads.spec.ts:42–49  ·  view source on GitHub ↗

Builds a Response-like object accepted by rxjs `fromFetch`.

(body: unknown, init?: { ok?: boolean; status?: number })

Source from the content-addressed store, hash-verified

40
41/** Builds a Response-like object accepted by rxjs `fromFetch`. */
42function jsonResponse(body: unknown, init?: { ok?: boolean; status?: number }) {
43 const ok = init?.ok ?? true;
44 return {
45 ok,
46 status: init?.status ?? (ok ? 200 : 500),
47 json: () => Promise.resolve(body),
48 } as unknown as Response;
49}
50
51/**
52 * Stub of the ambient {@link CopilotKit} service. Exposes the signals and the

Callers 1

threads.spec.tsFile · 0.70

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…