feat(isMobilePhone): add Palestine ar-PS locale by brendan-c · Pull Request #1767 · validatorjs/validator.js

@brendan-c

feat(isMobilePhone) add Palestine validation (ar-PS)

  • Added validation for Palestine mobile phone numbers
  • Wrote test for Palestine mobile phone number validation
  • Updated readme to include ar-PS

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@codecov

tux-tn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @brendan-c and thank you for your PR! Can you please address my comment below?

'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[8|9](\d{7})$/,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't prefixes for mobile phone numbers 9 and 6 instead of 8? The only source i can find is this wikipedia article

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the changes requested to validator.js 079c113

And updated the tests f434556

@brendan-c

@brendan-c

tux-tn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Thank you for your efforts 🎉

@profnandaa

@brendan-c - please fix the merge conflict and we should be good to go.

@profnandaa

Your work is now merged here #1851

@profnandaa profnandaa changed the title feat: (isMobilePhone) add Palestine validation feat(isMobilePhone): add Palestine ar-PS locale

Oct 31, 2021