Tuple to Union
提出詳細
type TupleToUnion<T extends readonly unknown[]> = T[number]
提出日時 | 2023-09-13 09:28:17 |
---|---|
問題 | Tuple to Union |
ユーザー | sankantsu |
ステータス | Accepted |
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<TupleToUnion<[123, '456', true]>, 123 | '456' | true>>, Expect<Equal<TupleToUnion<[123]>, 123>>, ]