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

isValidPhoneNumber and parsePhoneNumber validate the number incorrectly #444

Open
SergeiEensalu opened this issue May 22, 2023 · 6 comments

Comments

@SergeiEensalu
Copy link

If you call isValidPhoneNumber("+485555555"), it returns that it is a valid Polish number.

If you call parsePhoneNumber("+485555555"), then the result:

  PhoneNumber {
    country: 'PL',
    countryCallingCode: '48',
    nationalNumber: '5555555',
    number: '+485555555',
    metadata: {
    version: 4,
    ....
  }
}

Actually this is not true because 5555555 is not a Polish phone number. Exactly the same problem with the combination +481111111

Version
"libphonenumber-js": "^1.10.30",

@catamphetamine
Copy link
Owner

What's the exact issue?

@SergeiEensalu
Copy link
Author

SergeiEensalu commented May 22, 2023

isValidPhoneNumber("+485555555") returns true, but should return false.

@catamphetamine
Copy link
Owner

isValidPhoneNumber("+485555555") returns true, but should return false.

Provide an online demo illustrating the issue.

@catamphetamine
Copy link
Owner

And that online demo should use the "max" metadata

@T-Lukashevich
Copy link

Same problem
with number +375854545 or +3758*****

2023-05-25.14.25.28.mov

@LMarcinkowski
Copy link

Polish numbers has 9 digits, not 7.

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

No branches or pull requests

4 participants