| 250 | * @since 4.0.0 |
| 251 | */ |
| 252 | export const schemaHeaders = <A, I extends Readonly<Record<string, string | undefined>>, RD>( |
| 253 | schema: Schema.ConstraintCodec<A, I, RD, unknown>, |
| 254 | options?: ParseOptions | undefined |
| 255 | ): Effect.Effect<A, Schema.SchemaError, HttpServerRequest | RD> => { |
| 256 | const parse = Schema.decodeUnknownEffect(schema) |
| 257 | return Effect.flatMap(HttpServerRequest, (req) => parse(req.headers, options)) |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * Decodes a schema from the parsed search parameters of the current request. |