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(isMobilePhone): Add South Sudan Locale And Prefix(SS) #2084

Merged
merged 5 commits into from
Jan 22, 2023
Merged

feat(isMobilePhone): Add South Sudan Locale And Prefix(SS) #2084

merged 5 commits into from
Jan 22, 2023

Conversation

cheboi
Copy link
Contributor

@cheboi cheboi commented Oct 21, 2022

added validation and test for isMobile code Locale for (SS).
reference file: https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000F90002PDFE.pdf

Checklist

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

@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

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

Coverage data is based on head (6dcd6fb) compared to base (c19777a).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2084   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          104       104           
  Lines         2328      2328           
  Branches       584       584           
=========================================
  Hits          2328      2328           
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.

rubiin
rubiin previously approved these changes Oct 22, 2022
@rubiin rubiin added ready-to-land For PRs that are reviewed and ready to be landed ✅ LGTM hacktoberfest-accepted labels Oct 22, 2022
ezkemboi
ezkemboi previously approved these changes Oct 23, 2022
Copy link
Member

@ezkemboi ezkemboi left a comment

Choose a reason for hiding this comment

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

LGTM

@pano9000
Copy link
Contributor

pano9000 commented Dec 4, 2022

Hello all,

After reading the provided reference, I think the RegExp is too permissive currently and would match invalid phone numbers as well.

According to the reference above, there are only 4 valid "mobile access codes":

  • 91
  • 92
  • 95
  • 97

So the RegExp should actually check for these as well.
Currently it only checks for that first 9, so an invalid number like the following would match as valid;
+211932345678 (invalid, because mobile access code 93 does not exist)

Not an expert on South Sudan though, so please correct me if I am wrong.

However, If I am right, the corrected RegExp in my opinion should look like this:

/^(\+?211|0)(9[1257])\d{7}$/

Examples:

Valid:
+211911234567
+211921234567
+211951234567
+211971234567

Invalid:
+211981234567
+211931234567
+211901234567
+211991234567

@cheboi
Copy link
Contributor Author

cheboi commented Dec 5, 2022

Hello,
Thank you @pano9000, I will check on that

@pano9000
Copy link
Contributor

@rubiin could you kindly update the labels, seeing that this still needs some changes?

@rubiin rubiin added 🧹 needs-update For PRs that need to be updated before landing and removed hacktoberfest-accepted ready-to-land For PRs that are reviewed and ready to be landed ✅ LGTM labels Jan 21, 2023
@rubiin rubiin requested a review from ezkemboi January 21, 2023 22:57
@cheboi cheboi dismissed stale reviews from ezkemboi and rubiin via 6dcd6fb January 22, 2023 07:47
@pano9000
Copy link
Contributor

@cheboi thank you for the update!
@rubiin thanks, I think we can now remove the "needs-update" label now

(@profnandaa would it be possible for me to gain rights to add/remove labels for the issues/PRs? I'd be glad to help with that. let me know, what the process for that would like like)

@rubiin rubiin added ready-to-land For PRs that are reviewed and ready to be landed ✅ LGTM and removed 🧹 needs-update For PRs that need to be updated before landing labels Jan 22, 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, thanks for your contrib! 🎉

@profnandaa profnandaa merged commit 41c7a16 into validatorjs:master Jan 22, 2023
@profnandaa
Copy link
Member

@pano9000 -- sure, I've sent you an invite, let me know if you've seen it. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 first-pr ✅ LGTM ready-to-land For PRs that are reviewed and ready to be landed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants