MCPcopy Create free account
hub / github.com/Effect-TS/effect / jsonUnsafe

Function jsonUnsafe

packages/effect/src/http/HttpBody.ts:346–347  ·  view source on GitHub ↗
(body: unknown, contentType?: string)

Source from the content-addressed store, hash-verified

344 * @since 4.0.0
345 */
346export const jsonUnsafe = (body: unknown, contentType?: string): Uint8Array =>
347 text(JSON.stringify(body), contentType ?? "application/json")
348
349/**
350 * Creates a JSON HTTP body in an `Effect`.

Callers

nothing calls this directly

Calls 1

textFunction · 0.70

Tested by

no test coverage detected