-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(isUpiId): Added regex and tests for UPI id validation #2318
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't thought about the usefulness of this validator yet, but do have an initial comment
@@ -14463,54 +14463,32 @@ describe('Validators', () => { | |||
], | |||
}); | |||
}); | |||
it('should validate mailto URI', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove existing tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied the existing test for the format and modified it according to my function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WikiRik can you check I modified the code and fixed the bugs!
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2318 +/- ##
==========================================
- Coverage 99.95% 98.57% -1.39%
==========================================
Files 107 108 +1
Lines 2454 2457 +3
Branches 619 620 +1
==========================================
- Hits 2453 2422 -31
- Misses 0 35 +35
+ Partials 1 0 -1
☔ View full report in Codecov by Sentry. |
Users can use this in those scenarios where they are storing some UPI id in their database which is quite crucial and a well defined format or a check should be there so that they cannot fill any type of data they wish to store rather a proper formatted data would be stored in database. Also in certain scenarios it might catch the typos made by the users. |
Added validation for a given UPI id so that people can validate the UPI addresses before performing any transaction as per issue #2317 .
Read more about UPI(Unified Payments Interface): https://en.wikipedia.org/wiki/Unified_Payments_Interface
Checklist