-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
isMobilePhone - fixed validation for am-AM #2140
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
Changes from 6 commits
78c73cb
98b9fdf
9b2aa48
043eba1
680b016
374dbb0
4bf31c5
ce55c93
158489b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ import assertString from './util/assertString'; | |||||
|
|
||||||
| /* eslint-disable max-len */ | ||||||
| const phones = { | ||||||
| 'am-AM': /^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/, | ||||||
| 'am-AM': /^(\+?374|0)(1[0125][2-9]|22[2346]|23[1-7]|24[2-69]|25[2-7]|26[1-9]|28[13-7]|3[12]2|(33|4[134]|55|77|88|9[13-689])\d)\d{5}$/, | ||||||
|
||||||
| 'am-AM': /^(\+?374|0)(1[0125][2-9]|22[2346]|23[1-7]|24[2-69]|25[2-7]|26[1-9]|28[13-7]|3[12]2|(33|4[134]|55|77|88|9[13-689])\d)\d{5}$/, | |
| 'am-AM': /^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/, |
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,
pattern for fixed phone numbers has been removed, only mobile numbers are covered now there.
Thank you for suggestion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6458,14 +6458,20 @@ describe('Validators', () => { | |
| '022698763', | ||
| '37491987654', | ||
| '+37494567890', | ||
| '+37455123456', | ||
| '+37477123456', | ||
| '+37488123456', | ||
| ], | ||
| invalid: [ | ||
| '12345', | ||
| '+37411498855', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is sort of minor "breaking change", can you move the removed test-cases to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| '+37411498123', | ||
| '+37403498855', | ||
| '+37416498123', | ||
| '05614988556', | ||
| '', | ||
| '37456789000', | ||
| '37486789000', | ||
| '+37431312345', | ||
| '+37430312345', | ||
| '+37460123456', | ||
| ], | ||
| }, | ||
| { | ||
|
|
||
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.
nit: wondering if this regex could be any simpler?
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 don't think, I did all my best to combine and simplify similar parts.