github gvergnaud/ts-pattern v2.2.3

latest releases: v5.1.1, v5.1.0, v5.0.8...
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.