devtypes
    Preparing search index...

    Type Alias UnionToIntersection<U>

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

    Convert a union to an intersection

    Type Parameters

    • U
    type U = { a: number } | { b: string };
    type I = UnionToIntersection<U>;
    // { a: number } & { b: string }