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): Added validation for Country: Eritrea #1880

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

Conversation

kuldp18
Copy link

@kuldp18 kuldp18 commented Dec 3, 2021

I have added the validation for country named Eritrea in isMobilePhone validator, updated the readme and also written the tests.

Checklist

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

@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #1880 (8ed163b) into master (f055c11) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1880   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          102       102           
  Lines         2072      2072           
  Branches       472       472           
=========================================
  Hits          2072      2072           
Impacted Files Coverage Δ
src/lib/isMobilePhone.js 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f055c11...8ed163b. Read the comment docs.

Copy link
Member

@tux-tn tux-tn left a comment

Choose a reason for hiding this comment

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

Thank you for your PR @kuldp18 . Can you please address my comment?

@@ -125,6 +125,7 @@ const phones = {
'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,
'tg-TJ': /^(\+?992)?[5][5]\d{7}$/,
'th-TH': /^(\+66|66|0)\d{9}$/,
'ti-ER': /^(\+?291) ?\d{10}$/,
Copy link
Member

Choose a reason for hiding this comment

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

Looks like there is some mobile carrier prefixes according to ITU. Can you change your regex in a way to validate only mobile phone numbers. Also, is the space in your regex necessary?

@tux-tn tux-tn added 🎉 first-pr 🧹 needs-update For PRs that need to be updated before landing labels Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 first-pr 🧹 needs-update For PRs that need to be updated before landing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants