Skip to content

Commit

Permalink
Add en-mu locale (Mauritian)
Browse files Browse the repository at this point in the history
  • Loading branch information
bubenkoff committed Nov 5, 2018
1 parent c12af3c commit cc4aa2e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var phones = {
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
'en-KE': /^(\+?254|0)?[7]\d{8}$/,
'en-MU': /^(\+?230|0)?\d{8}$/,
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
Expand Down
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const phones = {
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
'en-KE': /^(\+?254|0)?[7]\d{8}$/,
'en-MU': /^(\+?230|0)?\d{8}$/,
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
Expand Down
23 changes: 23 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,29 @@ describe('Validators', () => {
'+99676338855',
],
},
{
locale: 'en-MU',
valid: [
'+23012341234',
'12341234',
'012341234',
],
invalid: [
'41234',
'',
'+230',
'+2301',
'+23012',
'+230123',
'+2301234',
'+23012341',
'+230123412',
'+2301234123',
'+230123412341',
'+2301234123412',
'+23012341234123',
],
},
{
locale: ['nb-NO', 'nn-NO'], // for multiple locales
valid: [
Expand Down
1 change: 1 addition & 0 deletions validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,7 @@ var phones = {
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
'en-KE': /^(\+?254|0)?[7]\d{8}$/,
'en-MU': /^(\+?230|0)?\d{8}$/,
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit cc4aa2e

Please sign in to comment.