Partially Required
Make some keys on a type required. Opposite of PartiallyOptional.
typescript
type PartiallyRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>
Usage
typescript
type User = {
name?: string
email?: string
}
// Type where `email` is required, but `name` is still optional
type UserWithEmailRequired = PartiallyRequired<User, 'email'>