Type Challenges Judge

Tuple to Union

提出詳細

type TupleToUnion<T> = T extends any[] ? T[number] : never
提出日時2023-08-07 17:11:23
問題Tuple to Union
ユーザーookkoouu
ステータス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>>, ]