Skip to content

Commit

Permalink
fix(matches): prevent regex state from breaking following validations (
Browse files Browse the repository at this point in the history
  • Loading branch information
fedeci authored Jun 30, 2022
1 parent 97d992c commit 9a0bb35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default function matches(str, pattern, modifiers) {
if (Object.prototype.toString.call(pattern) !== '[object RegExp]') {
pattern = new RegExp(pattern, modifiers);
}
return pattern.test(str);
return !!str.match(pattern);
}

0 comments on commit 9a0bb35

Please sign in to comment.