| 265 | * @since 4.0.0 |
| 266 | */ |
| 267 | export const schemaSearchParams = < |
| 268 | A, |
| 269 | I extends Readonly<Record<string, string | ReadonlyArray<string> | undefined>>, |
| 270 | RD |
| 271 | >( |
| 272 | schema: Schema.ConstraintCodec<A, I, RD, unknown>, |
| 273 | options?: ParseOptions | undefined |
| 274 | ): Effect.Effect<A, Schema.SchemaError, ParsedSearchParams | RD> => { |
| 275 | const parse = Schema.decodeUnknownEffect(schema) |
| 276 | return Effect.flatMap(ParsedSearchParams, (params) => parse(params, options)) |
| 277 | } |
| 278 | /** |
| 279 | * Reads the current request body as JSON and decodes it with the supplied schema. |
| 280 | * |