UNPKG

ts-essentials

Version:
3 lines (2 loc) 225 B
export type UnionToIntersection<Union> = (Union extends any ? (arg: Union) => void : never) extends (arg: infer Intersection) => void ? // Order matters here - do not swap Intersection and Union Intersection & Union : never;