Open ForbesLindesay opened 3 years ago
https://github.com/pelotom/runtypes/pull/162 looks like a pretty good start. I'm inclined not to attempt to make it a generic parameter, since it doesn't really affect the TypeScript type of the parsed value.
(Would also resolve https://github.com/pelotom/runtypes/issues/169 and https://github.com/pelotom/runtypes/issues/41)
Added in #56
There is currently no way to disallow additional properties on records. The closest you could get would be to Intersect the Record with a Dictionary that specifies the allowed fields.
Proposed API: