Implement the advanced util type UnionToIntersection<U>
For example
type I = UnionToIntersection<'foo' | 42 | true> // expected to be 'foo' & 42 & true
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)>>,
]