( body: unknown, options?: Options.WithContentType | undefined )
| 308 | * @since 4.0.0 |
| 309 | */ |
| 310 | export const json = ( |
| 311 | body: unknown, |
| 312 | options?: Options.WithContentType | undefined |
| 313 | ): Effect.Effect<HttpServerResponse, Body.HttpBodyError> => { |
| 314 | const headers = options?.headers ? Headers.fromInput(options.headers) : Headers.empty |
| 315 | return Effect.map(Body.json(body, getContentType(options, headers)), (body) => |
| 316 | makeResponse({ |
| 317 | status: options?.status ?? 200, |
| 318 | statusText: options?.statusText, |
| 319 | headers, |
| 320 | cookies: options?.cookies, |
| 321 | body |
| 322 | })) |
| 323 | } |
| 324 | |
| 325 | /** |
| 326 | * Creates a JSON response constructor backed by a schema encoder. |
nothing calls this directly
no test coverage detected