Make specific properties non-nullable.
Source object type
Keys to make non-nullable
1.1.0
Removes null and undefined from the selected property value types.
null
undefined
type User = { id: number | null; name?: string | undefined; email: string | null };type NonNullableUser = NonNullableProps< User, 'id' | 'name' >;// { id: number; name?: string; email: string | null; } Copy
type User = { id: number | null; name?: string | undefined; email: string | null };type NonNullableUser = NonNullableProps< User, 'id' | 'name' >;// { id: number; name?: string; email: string | null; }
Make specific properties non-nullable.