funtypes icon indicating copy to clipboard operation
funtypes copied to clipboard

Extend Object

Open ForbesLindesay opened this issue 5 years ago • 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: https://github.com/pelotom/runtypes/issues/127

Also related is a request to be able to make a "partial" from an intersection: https://github.com/pelotom/runtypes/issues/52

ForbesLindesay avatar Sep 06 '20 15:09 ForbesLindesay

The linked https://github.com/pelotom/runtypes/issues/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?

MicahZoltu avatar Feb 02 '23 15:02 MicahZoltu