mojotech / json-type-validation

TypeScript JSON type validation
MIT License
155 stars 14 forks source link

Decode index type objects? #33

Closed r-k-b closed 5 years ago

r-k-b commented 5 years ago

Is it possible to represent this type with a decoder?

interface Map<T> {
    [key: string]: T;
}
mulias commented 5 years ago

That's the dict decoder. Also, I only recently found out that there's a built in helper for indexed object types, which is Record<string, T>.

r-k-b commented 5 years ago

Thanks, mulias!