catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.79k stars 216 forks source link

German phone number starting with letter is seen as valid #416

Closed kasium closed 2 years ago

kasium commented 2 years ago

Steps to reproduce

parsePhoneNumberFromString('a123321312321', 'DE')

Observed result

isValid returns true

Expected result

isValid should return false. The demo also returns true.

Google's demo link

Google returns this result: https://libphonenumber.appspot.com/phonenumberparser?number=a123321312321&country=DE&geocodingLocale=de-DE. Seems like isValidNumber returns false.

catamphetamine commented 2 years ago

Number is valid.

What did you mean by that

kasium commented 2 years ago

Sorry, corrected. Meant that isValid returns true

catamphetamine commented 2 years ago

https://github.com/catamphetamine/libphonenumber-js#isvalid-boolean

kasium commented 2 years ago

Thanks. I was not aware of that!