v2.2.3
A few bug fixes regarding type inference:
- Improved support for readonly inputs
- Fix a bug with exhaustive matching: string and number literals (like
"hello"or2) where inferred asstringandnumber. When patterns were containing literals, the pattern matching expression was considered exhaustive, even though it wasn't. - Fix an inference issue with
any: If ananytype was contained in your input data structure, ts-pattern was sometimes unable to infer which branch of the input type was matching your pattern.