Creates a type with all properties of T except for those in union K. This is a relaxed version that ignores invalid keys automatically.
T
K
The object type to omit from.
The union of keys to omit.
An object type without the valid specified properties.
type Person = { name: string; age: number; email: string };type PublicInfo = RelaxedOmit<Person, 'email' | 'invalid'>; // { name: string; age: number }type Same = RelaxedOmit<Person, 'nonexistent'>; // { name: string; age: number; email: string } Copy
type Person = { name: string; age: number; email: string };type PublicInfo = RelaxedOmit<Person, 'email' | 'invalid'>; // { name: string; age: number }type Same = RelaxedOmit<Person, 'nonexistent'>; // { name: string; age: number; email: string }
Creates a type with all properties of
Texcept for those in unionK. This is a relaxed version that ignores invalid keys automatically.