ianks / mini_phone

A fast phone number parser, validator and formatter for Ruby. This gem binds to Google's C++ libphonenumber for spec-compliance and performance.
MIT License
158 stars 7 forks source link

#valid not returning same response as valid_for_country? #7

Closed desheikh closed 3 years ago

desheikh commented 3 years ago

Hello! For a Canadian Alberta number: 8255649738

MiniPhone.valid_for_country?('8255649738', 'CA') => true
MiniPhone.parse('8255649738', 'CA').valid? => false
MiniPhone.parse('8255649738', 'CA').region_code => 'US'

Based on https://libphonenumber.appspot.com/phonenumberparser?number=8255649738&country=CA the response should be true and CA.

ianks commented 3 years ago

Thanks for the report, looking into this now.

ianks commented 3 years ago

Should be fixed now :smile: