Replies: 1 comment
-
This time there's no lucky 😆 I think there isn't exactly that type. By the way, I think it's a useful feature and it could be added, or via a third generic argument as a "configuration" to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What I want to to is to for example safely replace {c: number} to {c: string}. The
type Replace<T, R extends Partial<Record<keyof T, any>>> = Omit<T, keyof R> & R;
I have allows exactly this, but I couldn't find a type in this lib that does this, by having R extending T, so it helps me building R and keeps it type safe.There are similar types in the lib, like
Update<O extends object, K extends Key ...
Modify<O extends object, OMod extends object>
type Overwrite<O extends object, O1 extends object>
But none of them, that I've found, have a second generic that extends the origin obj type.
Beta Was this translation helpful? Give feedback.
All reactions