Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 277 Bytes

TupleOrArray.md

File metadata and controls

11 lines (8 loc) · 277 Bytes

TupleOrArray<T> Type

Converts the specified type T into the array of T or just T if it's a valid tuple.

Implementation

export type TupleOrArray<T> = T extends [...infer _Rest] ? T : T[]
  • Type Parameters:
    • T (any): The type to convert.