Type alias UnionPick<type, keys>

UnionPick<type, keys>: type extends any
    ? Pick<type, keys>
    : never

Type Parameters

  • type
  • keys extends keyof type

Description

Construct a type with the properties of union type T except for those in type K.

Example

type Result = UnionOmit<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>
=> { b: number } | { b: undefined, c: number }