Type Alias Tail2TypesOrUndefined<T, U>

Tail2TypesOrUndefined<T, U>: T extends []
    ? U
    : T extends [unknown]
        ? U
        : T extends [unknown, unknown]
            ? U
            : Tail<Tail<T>>[number]

Returns the union of types in an array, but the first and the second one, uses U as a fallback if the array is empty.

Type Parameters

  • T extends AnyArray
  • U = undefined