Closed Joncom closed 4 years ago
Is this library able to validate a hash table with arbitrary keys, yet consistent value types?
For example:
type Example = { a: string, b: number, c: { [name: string]: number } };
Can c be validated to ensure the keys are strings and the values are numbers, even though the keys are not explicitly declared?
c
const exampleDecoder: Decoder<Example> = object({ a: string(), b: number(), c: object(/* not sure what goes here */) })
Is this library able to validate a hash table with arbitrary keys, yet consistent value types?
For example:
Can
c
be validated to ensure the keys are strings and the values are numbers, even though the keys are not explicitly declared?