(annotations?: Schema.Annotations.Filter)
| 3711 | * **Details** |
| 3712 | * |
| 3713 | * After flipping, what was decoding becomes encoding and vice versa. This is |
| 3714 | * the core operation behind `Schema.encode` — encoding a value is decoding |
| 3715 | * with a flipped SchemaAST. |
| 3716 | * |
| 3717 | * - Memoized: same input reference → same output reference. |
| 3718 | * - Recursively walks composite nodes. |
| 3719 | * |
| 3720 | * @see {@link toType} |
| 3721 | * @see {@link toEncoded} |
| 3722 | * @category transforming |
| 3723 | * @since 4.0.0 |
| 3724 | */ |
| 3725 | export const flip = memoize((ast: AST): AST => { |
| 3726 | if (ast.encoding) { |
| 3727 | return flipEncoding(ast, ast.encoding) |
| 3728 | } |
no test coverage detected
searching dependent graphs…