Home > types-kit > TupleToUnion
Convert a tuple to union type.
Signature:
export type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never// Expect: string | number
type Foo = TupleToUnion<[string, number]>Home > types-kit > TupleToUnion
Convert a tuple to union type.
Signature:
export type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never// Expect: string | number
type Foo = TupleToUnion<[string, number]>