sindresorhus / type-fest

A collection of essential TypeScript types
Creative Commons Zero v1.0 Universal
14.36k stars 545 forks source link

Proposal: Modify, a slightly modified version of Merge #604

Open Evertt opened 1 year ago

Evertt commented 1 year ago

Modify is like Merge, but it allows you to remove properties from the resulting type if you define that property in the Source with type never.

See this playground, it will explain everything: https://tsplay.dev/m0zRrw

Upvote & Fund

Fund with Polar

sindresorhus commented 1 year ago

What's your argument for making a new type instead of supporting this in Merge?

Evertt commented 1 year ago

Yeah no good reason, I'd be very happy if this was just supported in Merge by default. And even better if it could be supported in MergeDeep as well.