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

chore: fix merge conflicts #1851

Merged
merged 11 commits into from
Oct 31, 2021
Prev Previous commit
Next Next commit
feat(isMobilePhone): add Maldives dv-MV locale
chore: squashed #1829

Add locale for Maldives in mobile phone validator

Add tests for mobile numbers validation of maldives locale i.e. dv-MV

Update readme to add Maldives locale (dv-MV) in isMobilePhone documentation
  • Loading branch information
Prajwalrajbasnet authored and profnandaa committed Oct 31, 2021
commit c96d8059857af2e51a943197bd16b3e88e7efdcc
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const phones = {
'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
'de-CH': /^(\+41|0)([1-9])\d{1,9}$/,
'de-LU': /^(\+352)?((6\d1)\d{6})$/,
'dv-MV': /^(\+?960)?(7[2-9]|91|9[3-9])\d{7}$/,
'el-GR': /^(\+?30|0)?(69\d{8})$/,
'en-AU': /^(\+?61|0)4\d{8}$/,
'en-BM': /^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}))/,
Expand Down
17 changes: 17 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -8343,6 +8343,23 @@ describe('Validators', () => {
'66338855',
],
},
{
locale: 'dv-MV',
valid: [
'+960973256874',
'781246378',
'+960766354789',
'+960912354789',
],
invalid: [
'+96059234567',
'+96045789',
'7812463784',
'+960706985478',
'+960926985478',
'NotANumber',
],
},
];

let allValid = [];
Expand Down