Skip to content

Commit

Permalink
feat(isMobilePhone): add Palestine ar-PS locale
Browse files Browse the repository at this point in the history
Add isMobilePhone test for ar-PS

Add ar-PS to isMobilePhone readme

Correct ar-PS validation

Update ar-PS isMobible tests
  • Loading branch information
brendan-c authored and profnandaa committed Oct 31, 2021
1 parent 832c043 commit 12b159d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Expand Up @@ -14,6 +14,7 @@ const phones = {
'ar-LY': /^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,
'ar-MA': /^(?:(?:\+|00)212|0)[5-7]\d{8}$/,
'ar-OM': /^((\+|00)968)?(9[1-9])\d{6}$/,
'ar-PS': /^(\+?970|0)5[6|9](\d{7})$/,
'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
'ar-TN': /^(\+?216)?[2459]\d{7}$/,
Expand Down
20 changes: 20 additions & 0 deletions test/validators.js
Expand Up @@ -6027,6 +6027,26 @@ describe('Validators', () => {
'02122333',
],
},
{
locale: 'ar-PS',
valid: [
'+970563459876',
'970592334218',
'0566372345',
'0598273583',
],
invalid: [
'+9759029487',
'97059123456789',
'598372348',
'97058aaaafjd',
'',
'05609123484',
'+97059',
'+970',
'97056',
],
},
{
locale: 'ar-SY',
valid: [
Expand Down

0 comments on commit 12b159d

Please sign in to comment.