MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / json

Function json

telemetry-dashboard/src/index.ts:94–108  ·  view source on GitHub ↗
(body: unknown, init: ResponseInit = {})

Source from the content-addressed store, hash-verified

92}
93
94function json(body: unknown, init: ResponseInit = {}): Response {
95 const { headers, ...rest } = init;
96 return withSecurityHeaders(
97 new Response(JSON.stringify(body), {
98 ...rest,
99 headers: headersWith(
100 {
101 'content-type': 'application/json; charset=utf-8',
102 'cache-control': 'no-store',
103 },
104 headers,
105 ),
106 }),
107 );
108}
109
110function redirect(location: string, init: ResponseInit = {}): Response {
111 const { headers, status, ...rest } = init;

Callers 2

apiResponseFunction · 0.70
fetchFunction · 0.70

Calls 2

withSecurityHeadersFunction · 0.85
headersWithFunction · 0.85

Tested by

no test coverage detected