github gvergnaud/ts-pattern v3.2.4

latest releases: v5.1.1, v5.1.0, v5.0.8...
2 years ago

Improvements

  • .otherwise now passes the input value to the handler function. This can be useful when your default handler is a statically defined function and you want to avoid writing an intermediary anonymous function passing the input to it. PR #37 from @oguimbal 🙏

Bug fix

  • It's now possible to pattern-match on native Error objects. To save some compilation time, deep pattern matching on builtin objects is disabled, but it turns out this can be pretty handy to pattern match on native Error objects because some libs (like @apollo/client) enhance them with additional properties.

Don't miss a new ts-pattern release

NewReleases is sending notifications on new releases.