MCPcopy
hub / github.com/Effect-TS/effect / unsafeJson

Function unsafeJson

packages/platform/src/internal/httpServerResponse.ts:212–224  ·  view source on GitHub ↗
(
  body: unknown,
  options?: ServerResponse.Options.WithContentType | undefined
)

Source from the content-addressed store, hash-verified

210
211/** @internal */
212export const unsafeJson = (
213 body: unknown,
214 options?: ServerResponse.Options.WithContentType | undefined
215): ServerResponse.HttpServerResponse => {
216 const headers = options?.headers ? Headers.fromInput(options.headers) : Headers.empty
217 return new ServerResponseImpl(
218 options?.status ?? 200,
219 options?.statusText,
220 headers,
221 options?.cookies ?? Cookies.empty,
222 internalBody.unsafeJson(body, getContentType(options, headers))
223 )
224}
225
226/** @internal */
227export const schemaJson = <A, I, R>(

Callers

nothing calls this directly

Calls 1

getContentTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…