View all snippets

Distributive Omit

Omit a property from an object in a union, preserving the union types.

export type DistributiveOmit<T, K extends keyof T> = T extends unknown
  ? Omit<T, K>
  : never;