(transformation: {
readonly decode: SchemaGetter.Getter<S["Type"], S["Type"], RD>
readonly encode: SchemaGetter.Getter<S["Type"], S["Type"], RE>
})
| 5831 | * @since 4.0.0 |
| 5832 | */ |
| 5833 | export function decode<S extends Constraint, RD = never, RE = never>(transformation: { |
| 5834 | readonly decode: SchemaGetter.Getter<S["Type"], S["Type"], RD> |
| 5835 | readonly encode: SchemaGetter.Getter<S["Type"], S["Type"], RE> |
| 5836 | }) { |
| 5837 | return (self: S): decodeTo<toType<S>, S, RD, RE> => { |
| 5838 | return decodeTo<toType<S>, S, RD, RE>(toType(self), transformation)(self) |
| 5839 | } |
| 5840 | } |
| 5841 | /** |
| 5842 | * Reverses a schema transformation so the encoded schema is supplied first. |
| 5843 | * |
no test coverage detected