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

added-53 and 25 to be valid ghana cell phone first 2 digits after dialin… #2393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ubanitc
Copy link

@ubanitc ubanitc commented May 2, 2024

feat(isMobilePhone): Adds 53 and 25 to to valid ghana cell phone first 2 digits after dialing code

Currently ghana phone numbers have 53 and 25 as the numbers starting their phone numbers. and when these numbers are inputted it throws an error saying that they are invalid. when in fact they are valid phone numbers. this PR is supposed to fix that and add the new numbers

for example: +233593112756 gets validated. but doesn't +233533830853

Checklist

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

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (83d6ffd) to head (f70dc70).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2393   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          108       108           
  Lines         2482      2482           
  Branches       627       627           
=========================================
  Hits          2482      2482           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

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

Don't forget to add tests

@@ -41,7 +41,7 @@ const phones = {
'en-BS': /^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,
'en-GB': /^(\+?44|0)7\d{9}$/,
'en-GG': /^(\+?44|0)1481\d{6}$/,
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59|53|25)\d{7}$/,
Copy link
Member

Choose a reason for hiding this comment

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

According to https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000520009PDFE.pdf only 2540, 256 and 257 are valid.

53 is fine.

@rubiin
Copy link
Member

rubiin commented May 9, 2024

@ubanitc can you also include the source?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants