Home > @wixc3/common > UnionToIntersection
Make an intersection type from union
Signature:
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
const a:UnionToIntersection<{a:string}|{b:string}> = {a:'ok', b:'also ok'}