作者:xie392地址:https://v.douyin.com/ieQGrasM/更新时间:2024-12-21
1type UnionToIntersction<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never23type test = { a: string } | { b: number } | { c: boolean }45type test2 = UnionToIntersction<test> // { a: string } & { b: number } & { c: boolean }