Type Alias UnionPick<type, keys>

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

Type Parameters

  • type
  • keys extends keyof type

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

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