MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / readJson

Function readJson

apps/api/tests/api/auth/auth.routes.test.ts:52–60  ·  view source on GitHub ↗
(res: Response)

Source from the content-addressed store, hash-verified

50 : body;
51
52const readJson = async (res: Response): Promise<unknown> => {
53 if (!isJson(res)) {
54 const got = res.headers.get("content-type") ?? "<missing>";
55
56 throw new Error(`Expected JSON, got: ${got}`);
57 }
58
59 return res.json();
60};
61
62const isMessageEnvelope = (value: unknown): value is IMessageEnvelope =>
63 value !== null &&

Callers 1

Calls 2

isJsonFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected