You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.