github gvergnaud/ts-pattern v3.2.4

latest releases: v5.5.0, v5.4.0, v5.3.1...
3 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.