Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 | /**
* Turns a union into the intersection of its members: `A | B` gives `A & B`, to merge the types of a list
* of mixins or handlers.
*
* @template U - The members to intersect, as a union.
* @example
* type All = UnionToIntersection<{ a: 1 } | { b: 2 }>; // { a: 1 } & { b: 2 }
*/
export type UnionToIntersection<U> = (U extends unknown ? (value: U) => void : never) extends (value: infer I) => void
? I
: never;
|