( schema: Schema.ConstraintCodec<A, I, RD, unknown>, options?: ParseOptions | undefined )
| 235 | * @since 4.0.0 |
| 236 | */ |
| 237 | export const schemaCookies = <A, I extends Readonly<Record<string, string | undefined>>, RD>( |
| 238 | schema: Schema.ConstraintCodec<A, I, RD, unknown>, |
| 239 | options?: ParseOptions | undefined |
| 240 | ): Effect.Effect<A, Schema.SchemaError, RD | HttpServerRequest> => { |
| 241 | const parse = Schema.decodeUnknownEffect(schema) |
| 242 | return Effect.flatMap(HttpServerRequest, (req) => parse(req.cookies, options)) |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Decodes a schema from the headers of the current request. |