Skip to content

Commit

Permalink
feat(isMobilePhone): add Turkmenistan tk-TM
Browse files Browse the repository at this point in the history
squashed commits and resolved merge conflict for #1780

Add Turkmenistan validation regax

Update README.md to include Turkmenistan (tk-Tm)

Add test cases for tk-TM

add missing comma for isMobilePhone.js

add missing commas for test/validators.js
  • Loading branch information
husan-eshonqulov authored and profnandaa committed Oct 31, 2021
1 parent 0e5d5d4 commit 26605f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const phones = {
'tg-TJ': /^(\+?992)?[5][5]\d{7}$/,
'th-TH': /^(\+66|66|0)\d{9}$/,
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'tk-TM': /^(\+993|993|8)\d{8}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'uz-UZ': /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,
'vi-VN': /^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,
Expand Down
16 changes: 16 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -8201,6 +8201,22 @@ describe('Validators', () => {
'081234567891',
],
},
{
locale: 'tk-TM',
valid: [
'+99312495154',
'99312130136',
'+99312918407',
'99312183399',
'812391717',
],
invalid: [
'12345',
'+99412495154',
'99412495154',
'998900066506',
],
},
{
locale: ['en-ZA', 'be-BY'],
valid: [
Expand Down

0 comments on commit 26605f9

Please sign in to comment.