UnionToIntersection
UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : neverSource: common.ts:317
Union to intersection type conversion
Type Parameters
U— Union type
Example
CODE
type A = { a: string }
type B = { b: number }
type AB = UnionToIntersection<A | B>
// { a: string } & { b: number }