Type alias IsUnion<T, C>

IsUnion<T, C>: (T extends T
        ? C extends T
            ? true
            : unknown
        : never) extends true
    ? false
    : true

Checks if a type is a union type.

Type Parameters

  • T

    The type to check.

  • C extends T = T

    A candidate type that is a subtype of T.

Returns

true if the type is a union type, false otherwise.

Generated using TypeDoc