(transformation: {
readonly decode: SchemaGetter.Getter<S["Encoded"], S["Encoded"], RD>
readonly encode: SchemaGetter.Getter<S["Encoded"], S["Encoded"], RE>
})
| 5920 | * @since 4.0.0 |
| 5921 | */ |
| 5922 | export function encode<S extends Constraint, RD = never, RE = never>(transformation: { |
| 5923 | readonly decode: SchemaGetter.Getter<S["Encoded"], S["Encoded"], RD> |
| 5924 | readonly encode: SchemaGetter.Getter<S["Encoded"], S["Encoded"], RE> |
| 5925 | }) { |
| 5926 | return (self: S): decodeTo<S, toEncoded<S>, RD, RE> => { |
| 5927 | return decodeTo<S, toEncoded<S>, RD, RE>(self, transformation)(toEncoded(self)) |
| 5928 | } |
| 5929 | } |
| 5930 | /** |
| 5931 | * Constraint used to ensure a schema field does not already have a constructor default. |
| 5932 | * |
no test coverage detected