Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 467 Bytes

File metadata and controls

22 lines (13 loc) · 467 Bytes

Home > types-kit > TupleToUnion

TupleToUnion type

Convert a tuple to union type.

Signature:

export type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never

Example

// Expect: string | number
type Foo = TupleToUnion<[string, number]>