Skip to content

Commit 9a0bb35

Browse files
authored
fix(matches): prevent regex state from breaking following validations (#1975)
1 parent 97d992c commit 9a0bb35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/matches.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export default function matches(str, pattern, modifiers) {
55
if (Object.prototype.toString.call(pattern) !== '[object RegExp]') {
66
pattern = new RegExp(pattern, modifiers);
77
}
8-
return pattern.test(str);
8+
return !!str.match(pattern);
99
}

0 commit comments

Comments
 (0)