-
-
Notifications
You must be signed in to change notification settings - Fork 679
Proposal: DistributiveOmit #1395
Copy link
Copy link
Closed
Labels
Description
Type description + examples
import { IsUnion } from 'type-fest';
type _DistributiveOmit<T, K extends keyof any> = T extends any
? Omit<T, K>
: never;
type DistributiveOmit<T, K extends keyof any> = IsUnion<T> extends true
? _DistributiveOmit<T, K> // Distribute if it's a union
: Omit<T, K>; // Standard omit otherwiseType source
No response
Search existing types and issues first
- I tried my best to look for it
- related issue: [Proposal] Tagged Union To Intersection #173
Reactions are currently unavailable