Type Alias UnconstrainedTuple<T, N>

UnconstrainedTuple<T, N>: N extends N
    ? number extends N
        ? T[]
        : TupleOf<T, N, []>
    : never

Creates a tuple of T and size N which is unconstrained by size of N. So for large tuples the "Type instantiation is excessively deep and possibly infinite" TS error will occur.

Type Parameters

  • T
  • N extends number