| 366 | * @since 4.0.0 |
| 367 | */ |
| 368 | export const schemaBodyMultipart = <A, I extends Partial<Multipart.Persisted>, RD>( |
| 369 | schema: Schema.ConstraintCodec<A, I, RD, unknown>, |
| 370 | options?: ParseOptions | undefined |
| 371 | ): Effect.Effect< |
| 372 | A, |
| 373 | Multipart.MultipartError | Schema.SchemaError, |
| 374 | HttpServerRequest | Scope.Scope | FileSystem.FileSystem | Path.Path | RD |
| 375 | > => { |
| 376 | const parse = Multipart.schemaPersisted(schema) |
| 377 | return HttpServerRequest.pipe( |
| 378 | Effect.flatMap((_) => _.multipart), |
| 379 | Effect.flatMap((_) => parse(_, options)) |
| 380 | ) |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * Creates a decoder for a JSON value stored in a form field. |