Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly run .matches when passing regex object #1156

Merged
merged 2 commits into from
Jun 19, 2022
Merged

fix: correctly run .matches when passing regex object #1156

merged 2 commits into from
Jun 19, 2022

Conversation

tonysamperi
Copy link
Contributor

Description

Forcing pattern to be string, to cope with lib validator which doesn't reset the RegExp instance
Fixes #1127
Workaround of a behaviour which should be fixed in validator.js

To-do list

  • I have added tests for what I changed.
  • This pull request is ready to merge.

@fedeci
Copy link
Member

fedeci commented Jun 15, 2022

Merging and publishing this tomorrow morning! Sorry again for the delay!

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8c4059a on tonysamperi:bugfix/regex-instance into 82e4d84 on express-validator:master.

@fedeci fedeci merged commit 6b2edda into express-validator:master Jun 19, 2022
@tonysamperi tonysamperi deleted the bugfix/regex-instance branch June 19, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.matches failing when passing regex instead of pattern
3 participants