(schema: S, options?: ParseOptions | undefined)
| 62 | * @since 4.0.0 |
| 63 | */ |
| 64 | export const schemaBodyJson = <S extends Schema.Constraint>(schema: S, options?: ParseOptions | undefined) => { |
| 65 | const decode = Schema.decodeEffect(Schema.toCodecJson(schema)) |
| 66 | return <E>( |
| 67 | self: HttpIncomingMessage<E> |
| 68 | ): Effect.Effect<S["Type"], E | Schema.SchemaError, S["DecodingServices"]> => |
| 69 | Effect.flatMap(self.json, (u) => decode(u, options)) |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Creates a decoder that reads an incoming message's URL-encoded body parameters and decodes them with the supplied schema. |
nothing calls this directly
no test coverage detected