gvergnaud / hotscript

A library of composable functions for the type-level! Transform your TypeScript types in any way you want using functions you already know.
3.51k stars 59 forks source link

[Feature Request] Object.set #81

Closed Maggi64 closed 1 year ago

Maggi64 commented 1 year ago

Hi, thank you for the library 👍 How about we add Object.Set which is similar to Object.Update. But you can update and set new paths.

Call<Objects.Set<'a.b', 2>, { a: 1 }>;
// { a: { b: 2 }}
gvergnaud commented 1 year ago

Hey, thanks for the feedback, the fact that Object.Update doesn't create new property is a bug actually, just fixed it! I'll publish a new release with the fix soon.

gvergnaud commented 1 year ago

Publish as v1.0.11