(transformation: {
readonly decode: SchemaGetter.Getter<S["Type"], S["Type"], RD>
readonly encode: SchemaGetter.Getter<S["Type"], S["Type"], RE>
})
| 5642 | * @since 4.0.0 |
| 5643 | */ |
| 5644 | export function decode<S extends Constraint, RD = never, RE = never>(transformation: { |
| 5645 | readonly decode: SchemaGetter.Getter<S["Type"], S["Type"], RD> |
| 5646 | readonly encode: SchemaGetter.Getter<S["Type"], S["Type"], RE> |
| 5647 | }) { |
| 5648 | return (self: S): decodeTo<toType<S>, S, RD, RE> => { |
| 5649 | return decodeTo<toType<S>, S, RD, RE>(toType(self), transformation)(self) |
| 5650 | } |
| 5651 | } |
| 5652 | |
| 5653 | /** |
| 5654 | * Reverses a schema transformation so the encoded schema is supplied first. |
no test coverage detected