( from: Encoded, to: Type )
| 4011 | * @since 3.10.0 |
| 4012 | */ |
| 4013 | export function transformLiteral<Encoded extends AST.LiteralValue, Type extends AST.LiteralValue>( |
| 4014 | from: Encoded, |
| 4015 | to: Type |
| 4016 | ): transformLiteral<Type, Encoded> { |
| 4017 | return transform(Literal(from), Literal(to), { |
| 4018 | strict: true, |
| 4019 | decode: () => to, |
| 4020 | encode: () => from |
| 4021 | }) |
| 4022 | } |
| 4023 | |
| 4024 | /** |
| 4025 | * Creates a new `Schema` which maps between corresponding literal values. |
no test coverage detected