by redbar0n · 4y ago · 0 comments
https://www.typescriptlang.org/docs/handbook/unions-and-inte...
See last paragram under «Unions with common fields»
Leading to terribly confusing TypeScript cheat sheets such as this (see the union and intersection venn-diagrams):
https://carltheperson.com/images/magic-typescript/magic-type...
Compare with: https://en.wikipedia.org/wiki/Intersection_(set_theory)
Luckily TypeScript recently updated their docs, and the issue has been clarified in posts such as this:
https://stackoverflow.com/questions/38855908/naming-of-types...
Turns out, naming things is really hard, because what you implicitly refer to when you unionize or intersect turns out to be of vital importance.