Skip to content

isValidPhoneNumber and parsePhoneNumber validate the number incorrectly #444

Open
@SergeiEensalu

Description

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",

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions