npm ts-pattern 2.2.3
v2.2.3

latest releases: 5.5.0, 5.4.0, 5.3.1...
3 years ago

A few bug fixes regarding type inference:

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

Don't miss a new ts-pattern release

NewReleases is sending notifications on new releases.