| 117 | * @since 4.0.0 |
| 118 | */ |
| 119 | export const schemaNoBody = < |
| 120 | A, |
| 121 | I extends { |
| 122 | readonly status?: number | undefined |
| 123 | readonly headers?: Readonly<Record<string, string>> | undefined |
| 124 | }, |
| 125 | RD, |
| 126 | RE |
| 127 | >( |
| 128 | schema: Schema.Codec<A, I, RD, RE>, |
| 129 | options?: ParseOptions | undefined |
| 130 | ) => { |
| 131 | const decode = Schema.decodeEffect(schema.annotate({ options })) |
| 132 | return (self: HttpClientResponse): Effect.Effect<A, Schema.SchemaError, RD> => |
| 133 | decode({ |
| 134 | status: self.status, |
| 135 | headers: self.headers |
| 136 | } as any as I) |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Converts an effect producing an `HttpClientResponse` into a stream of response body bytes. |