Union to Intersection
提出詳細
type U2I<U> = (U extends unknown ? (arg: U) => void : never) extends (arg: infer I) => void ? I : never;
提出日時 | 2025-01-20 10:40:47 |
---|---|
問題 | Union to Intersection |
ユーザー | ookkoouu |
ステータス | Wrong Answer |
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<UnionToIntersection<'foo' | 42 | true>, 'foo' & 42 & true>>, Expect<Equal<UnionToIntersection<(() => 'foo') | ((i: 42) => true)>, (() => 'foo') & ((i: 42) => true)>>, ]