ts-type-forge
    Preparing search index...

    Type Alias UnionToIntersection<T>

    UnionToIntersection: (T extends unknown ? (arg: T) => void : never) extends (
        arg: infer F,
    ) => void
        ? F
        : never

    Converts a union type T into an intersection type.

    Type Parameters

    • T

      The union type.

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