Skip to content

Releases: sindresorhus/matcher

v5.0.0

03 Oct 09:31
Compare
Choose a tag to compare

Breaking

Improvements

v4.0.0...v5.0.0

v4.0.0

28 Feb 10:59
Compare
Choose a tag to compare

Breaking

  • When passing an empty array of rules to matcher(), it would return the entire array of inputs with no filtering. Now it will return an empty array.
  • When passing an empty array of rules to matcher.isMatch(), it would always return true. Now it will always return false.
  • In certain cases it was possible to pass unsupported variable types to the functions and still receive a normal return value. This is no longer possible because of explicit type checks. This would have been very buggy to use, and should not have been used in production, but it is still a breaking change.

Improvements

  • matcher() now also supports passing a string instead of an array of strings. This simplifies the code base and makes the interface consistent with matcher.isMatch().
  • Both functions now fully support passing undefined variables to them. This was mostly supported before, but had several edge cases where it would crash the process. It was possible to ship code that seemed to work, but would crash under certain conditions.

Fixes

  • When passing unsupported variable types in the arrays of either function, they will now throw a proper TypeError with an explanation instead of crashing in all sorts of interesting ways.

v3.0.0...v4.0.0

v3.0.0

26 Apr 16:13
Compare
Choose a tag to compare

Breaking

  • Require Node.js 10 2b693c9
  • Match across newlines a59c278
    This is unlikely to be breaking for most users, but it does slightly change the behavior of the matching.

v2.1.0...v3.0.0

v2.1.0

19 Nov 05:56
Compare
Choose a tag to compare
  • Support multiple inputs and patterns in matcher.isMatch() (#21) aab6a7b

v2.0.0...v2.1.0

v2.0.0

22 Apr 07:18
Compare
Choose a tag to compare

Breaking:

Enhancements:

v1.1.1...v2.0.0