I have this type:
type User = {
id: string;
name?: string;
email?: string;
}
And I would like to construct a similar type with name non optional:
type UserWithName = {
id: string;
name: string;
email?: string;
}
Instead of repeating the type as I did above, how can I construct UserWithName from User with generic utility types?
Required almost does the job but it sets all properties as non-optional, while I just want to set one property.