( body: unknown, options?: Options.WithContentType | undefined )
| 288 | * @since 4.0.0 |
| 289 | */ |
| 290 | export const json = ( |
| 291 | body: unknown, |
| 292 | options?: Options.WithContentType | undefined |
| 293 | ): Effect.Effect<HttpServerResponse, Body.HttpBodyError> => { |
| 294 | const headers = options?.headers ? Headers.fromInput(options.headers) : Headers.empty |
| 295 | return Effect.map(Body.json(body, getContentType(options, headers)), (body) => |
| 296 | makeResponse({ |
| 297 | status: options?.status ?? 200, |
| 298 | statusText: options?.statusText, |
| 299 | headers, |
| 300 | cookies: options?.cookies, |
| 301 | body |
| 302 | })) |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * Creates a JSON response constructor backed by a schema encoder. |
nothing calls this directly
no test coverage detected