Type alias ExcludeTail<T>

ExcludeTail<T>: T extends readonly [...(infer Head), unknown]
    ? T extends unknown[]
        ? Head
        : Readonly<Head>
    : T

Remove the last entry from a tuple type.

Type Parameters

  • T extends readonly unknown[]