daddyz / phonelib

Ruby gem for phone validation and formatting using google libphonenumber library data
MIT License
1.06k stars 130 forks source link

Valid New Mexican area code #308

Closed joshjoll closed 3 months ago

joshjoll commented 3 months ago

505 is a valid US/New Mexico area code that consistently fails validation.

Tested with phonelib locally

irb(main):002:0> Phonelib.parse('5056462563').valid?
=> false
irb(main):003:0> Phonelib.parse('505.646.2563').valid?
=> false

Tested in libphonenumber parser demo

****Parsing Result:****
{"country_code":1,"national_number":5056462563,"raw_input":"505.646.2563","country_code_source":20}

****Validation Results:****
Result from isPossibleNumber(): true
Result from isValidNumber(): true
Result from isValidNumberForRegion(): true
Phone Number region: US
Result from getNumberType(): FIXED_LINE_OR_MOBILE
joshjoll commented 3 months ago

Updating the gem locally fixed this. Issue is closed