| 207 | * @since 4.0.0 |
| 208 | */ |
| 209 | export const schemaHeaders = <A, I extends Readonly<Record<string, string | undefined>>, RD>( |
| 210 | schema: Schema.ConstraintCodec<A, I, RD, unknown>, |
| 211 | options?: ParseOptions | undefined |
| 212 | ): Effect.Effect<A, Schema.SchemaError, HttpServerRequest | RD> => { |
| 213 | const parse = Schema.decodeUnknownEffect(schema) |
| 214 | return Effect.flatMap(HttpServerRequest, (req) => parse(req.headers, options)) |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * Decodes a schema from the parsed search parameters of the current request. |