( body: unknown, options?: ServerResponse.Options.WithContentType | undefined )
| 194 | |
| 195 | /** @internal */ |
| 196 | export const json = ( |
| 197 | body: unknown, |
| 198 | options?: ServerResponse.Options.WithContentType | undefined |
| 199 | ): Effect.Effect<ServerResponse.HttpServerResponse, Body.HttpBodyError> => { |
| 200 | const headers = options?.headers ? Headers.fromInput(options.headers) : Headers.empty |
| 201 | return Effect.map(internalBody.json(body, getContentType(options, headers)), (body) => |
| 202 | new ServerResponseImpl( |
| 203 | options?.status ?? 200, |
| 204 | options?.statusText, |
| 205 | headers, |
| 206 | options?.cookies ?? Cookies.empty, |
| 207 | body |
| 208 | )) |
| 209 | } |
| 210 | |
| 211 | /** @internal */ |
| 212 | export const unsafeJson = ( |
nothing calls this directly
no test coverage detected