Extracts a union type from a tuple or readonly array.
For example: UnionFromArray<['a', 'b', 'c']> -> 'a' | 'b' | 'c'
A readonly array or tuple of values
A union of the array's element types
export type UnionFromArray<T extends readonly any[]> = T[number]; Copy
export type UnionFromArray<T extends readonly any[]> = T[number];
Extracts a union type from a tuple or readonly array.
For example: UnionFromArray<['a', 'b', 'c']> -> 'a' | 'b' | 'c'