TypeScript Snippet
UnionToIntersection Utility Type
Difficulty: Hard
Going from a union (`A | B | C`) to an intersection (`A & B & C`) is what you need when you want to merge handler shapes, deduce the most-specific type, or express a 'must satisfy all branches' constraint. TypeScript has no built-in for this, but a single conditional with `infer` does the job. This snippet builds the type, walks through how distributive conditionals make it work, and ties it to a concrete LastInUnion / merged-handlers example.
