UnionToIntersection: (U extends any ? (x: U) => void : never) extends (
    x: infer I,
) => void
    ? I
    : never

Converts a union type to an intersection type.

Type Parameters

  • U

    The union type to convert.

type Original = string | number;
type Mutated = UnionToIntersection<Original>; // string & number