(
to: To,
transformation?: {
readonly decode: SchemaGetter.Getter<To["Encoded"], From["Type"], RD>
readonly encode: SchemaGetter.Getter<From["Type"], To["Encoded"], RE>
} | undefined
)
| 5735 | } |
| 5736 | ): (from: From) => decodeTo<To, From, RD, RE> |
| 5737 | export function decodeTo<To extends Constraint, From extends Constraint, RD = never, RE = never>( |
| 5738 | to: To, |
| 5739 | transformation?: { |
| 5740 | readonly decode: SchemaGetter.Getter<To["Encoded"], From["Type"], RD> |
| 5741 | readonly encode: SchemaGetter.Getter<From["Type"], To["Encoded"], RE> |
| 5742 | } | undefined |
| 5743 | ) { |
| 5744 | return (from: From) => { |
| 5745 | return make( |
| 5746 | SchemaAST.decodeTo( |
| 5747 | from.ast, |
| 5748 | to.ast, |
| 5749 | transformation ? SchemaTransformation.makeTransformation(transformation) : SchemaTransformation.passthrough() |
| 5750 | ), |
| 5751 | { |
| 5752 | from, |
| 5753 | to |
| 5754 | } |
| 5755 | ) |
| 5756 | } |
| 5757 | } |
| 5758 | |
| 5759 | /** |
| 5760 | * Constructs a decode-only `SchemaAST.Link`. |
no test coverage detected