ForbesLindesay/funtypes

Extend Object

Opened this issue · 1 comments

The behaviour of Intersect isn't always very intuitive when it comes to objects. The behaviour people want is often much closer to "spread". We should implement something similar to Zod's extend method: https://github.com/vriad/zod#extending-objects

Related request: runtypes#127

Also related is a request to be able to make a "partial" from an intersection: runtypes#52

The linked runtypes#52 has a recommended workaround of Partial(Info.fields). Unfortunately, it doesn't appear that Funtypes exposes a fields property so this doesn't work. Is there some other way to make this work today in Funtypes?