Init<T>: T extends [...(infer R), infer _]
    ? R
    : never

Extracts the type info for all but the last item inside a tuple.

Type Parameters

  • T extends readonly unknown[]

Example

type Values = Init<[true, 1, '2']>;
// => [true, 1]

Generated using TypeDoc