( schema: Schema.ConstraintCodec<A, I, RD, unknown>, options?: ParseOptions | undefined )
| 87 | * @since 4.0.0 |
| 88 | */ |
| 89 | export const schemaJson = < |
| 90 | A, |
| 91 | I extends { |
| 92 | readonly status?: number | undefined |
| 93 | readonly headers?: Readonly<Record<string, string | undefined>> | undefined |
| 94 | readonly body?: unknown |
| 95 | }, |
| 96 | RD |
| 97 | >( |
| 98 | schema: Schema.ConstraintCodec<A, I, RD, unknown>, |
| 99 | options?: ParseOptions | undefined |
| 100 | ) => { |
| 101 | const decode = Schema.decodeEffect(Schema.toCodecJson(schema).annotate({ options })) |
| 102 | return ( |
| 103 | self: HttpClientResponse |
| 104 | ): Effect.Effect<A, Schema.SchemaError | Error.HttpClientError, RD> => |
| 105 | Effect.flatMap(self.json, (body) => |
| 106 | decode({ |
| 107 | status: self.status, |
| 108 | headers: self.headers, |
| 109 | body |
| 110 | })) |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Creates a decoder for a response's status and headers without reading a response body. |
nothing calls this directly
no test coverage detected