Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

UnionToIntersection

UnionToIntersection

@example
// Expect: { name: string } & { age: number } & { visible: boolean }
  UnionToIntersection<{ name: string } | { age: number } | { visible: boolean }>
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;

§Type Parameters

§Type

§
(U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never
[src]