Decoder that only accepts a specific value.
The exact value to accept
A decoder that only accepts the specified value
const oneDecoder = JsonDecoder.literal(1);oneDecoder.decode(1); // Ok<1>({value: 1})oneDecoder.decode(2); // Err({ issues: [{ message: '2 is not exactly 1', path: [] }] }) Copy
const oneDecoder = JsonDecoder.literal(1);oneDecoder.decode(1); // Ok<1>({value: 1})oneDecoder.decode(2); // Err({ issues: [{ message: '2 is not exactly 1', path: [] }] })
Decoder that only accepts a specific value.