Pattern matching in TypeScript today

JavaScript does not have pattern matching yet, but TypeScript developers can model states clearly and use ts-pattern for exhaustive pattern matching today.