gcanti / io-ts

Runtime type system for IO decoding/encoding
https://gcanti.github.io/io-ts/
MIT License
6.71k stars 329 forks source link

support partially enumerable `record` #707

Open tgfisher4 opened 12 months ago

tgfisher4 commented 12 months ago

WIP

This PR adds support to the record combinator for "partially enumerable" records, in which the domain is the disjoint union of some enumerable type and some non-enumerable type, such that the domain has an enumerable portion and a non-enumerable portion. In particular, the record combinator enforces that the entire enumerable portion of the domain is present (with values in the codomain), and that any present keys of the non-enumerable portion have values in the codomain, emulating the type-checking behavior of TypeScript.

Other changes: