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

feat: add support for DR Congo mobile phone validation (fr-CD) #2041

Closed
wants to merge 2 commits into from

Conversation

coolbeatz71
Copy link
Contributor

Checklist

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

@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (34b1099) compared to base (7b47f53).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2041   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          104       104           
  Lines         2308      2308           
  Branches       578       578           
=========================================
  Hits          2308      2308           
Impacted Files Coverage Δ
src/lib/isMobilePhone.js 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@coolbeatz71 coolbeatz71 changed the title feat: add support for DR Congo mobile phone validation feat: add support for DR Congo mobile phone validation (fr-CD) Sep 14, 2022
@coolbeatz71
Copy link
Contributor Author

Hey @rubiin, can anyone please review this PR?

@tux-tn tux-tn added ready-to-land For PRs that are reviewed and ready to be landed 🎉 first-pr labels Oct 19, 2022
@coolbeatz71
Copy link
Contributor Author

coolbeatz71 commented Nov 9, 2022

Hey @tux-tn @rubiin, can I expect this PR to be merged soon? Or somebody else needs to review it.

@coolbeatz71
Copy link
Contributor Author

Hey @profnandaa, your review on this PR will be highly appreciated. 😊

@@ -94,6 +94,7 @@ const phones = {
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
'fr-BF': /^(\+226|0)[67]\d{7}$/,
'fr-BJ': /^(\+229)\d{8}$/,
'fr-CD': /^(\+?243|0)?(8|9)\d{8}$/,
Copy link
Contributor

Choose a reason for hiding this comment

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

If I check the ITU numbering plan (page 1), it looks like the regexp here would be too permissive.

Kindly check the ranges that were officially announced in that document and adjust your regexp accordingly please.

Copy link
Contributor Author

@coolbeatz71 coolbeatz71 Jan 24, 2023

Choose a reason for hiding this comment

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

Hey @pano9000, nice catch! thx for the feedback.

You should also note that: the above document is very old 😂(from 2009). Some MNOs in this list are no longer operational. And there are even new operators with different numbering structure.

But I think I can come up with something like /^(\+?243|0)?(8|9)(0|1|2|4|7|8\9)\d{7}$/, so telephones such as +243 902 XXXXXXX can pass the regex.

What do you think about it?

Copy link
Member

Choose a reason for hiding this comment

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

The most recent document provided to ITU is from 2013; https://www.itu.int/oth/T0202000037/en
That document is less clear than those of some other countries but looking at the communication of 15.IX.2010 I would propose the RegExp to be the following; /^(\+?243|0)?(8[0-2|4|8|9]|9[7-9])\d{7}$/.
+243 902 XXXXXXX does not seem to be valid from the official source of the ITU, but if you can provide one from the national authorities that do show that this should be valid we can look at a different RegExp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The most recent document provided to ITU is from 2013; https://www.itu.int/oth/T0202000037/en That document is less clear than those of some other countries but looking at the communication of 15.IX.2010 I would propose the RegExp to be the following; /^(\+?243|0)?(8[0-2|4|8|9]|9[7-9])\d{7}$/. +243 902 XXXXXXX does not seem to be valid from the official source of the ITU, but if you can provide one from the national authorities that do show that this should be valid we can look at a different RegExp

Hey @WikiRik. My actual phone number is +243 902 575 693 from Africel 😂

@pano9000 pano9000 added 🧹 needs-update For PRs that need to be updated before landing and removed ready-to-land For PRs that are reviewed and ready to be landed labels Jan 22, 2023
@rubiin rubiin added the mc-to-land Just merge-conflict standing between the PR and landing. label Jan 23, 2023
Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

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

LGTM.

profnandaa added a commit that referenced this pull request Jan 31, 2023
- fixes #2040
- clean-up #2041 

Co-authored-by: coolbeatz71 <sigmacool@gmail.com>
@profnandaa
Copy link
Member

combined in #2164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 first-pr mc-to-land Just merge-conflict standing between the PR and landing. 🧹 needs-update For PRs that need to be updated before landing PR/combined
Projects
None yet
Development

Successfully merging this pull request may close these issues.

should add support for DR Congo mobile phone validation
6 participants