ts-type-forge
    Preparing search index...

    Type Alias RelaxedOmit<T, K>

    RelaxedOmit: Pick<T, RelaxedExclude<keyof T, K>>

    Creates a type with all properties of T except for those in union K. This is a relaxed version that ignores invalid keys automatically.

    Type Parameters

    • T

      The object type to omit from.

    • K

      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 }