Intersect
import type { Intersect } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/kind.ts";A type level utility that turns a type union into a type intersection. This type is dangerous and can have unexpected results so extra runtime testing is necessary when used.
type Intersect<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;