-
Notifications
You must be signed in to change notification settings - Fork 131
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
Only one country is returned in despite multiples matching #290
Comments
@aisler-ma interesting request, well, take this one as example, it works where there are multiple possibilities: phone = Phonelib.parse("1 (787) 240-2750")
phone.countries # => ["AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "US", "VC", "VG", "VI"]
phone.valid_countries # => ["PR"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all together,
awesome library and works pretty good! However, I noticed one issue: if one defines multiple countries to check—either via default values or as parameter—the tool check for all countries where the phone number is valid/possible, however returns only the first valid result. This is okay, if one wants to guess and just want to get one single result. However, it is also kind of confusing, and I have a use case where I want to check if the given number is possible in more than one country.
I also found the responsible line of code: https://github.com/daddyz/phonelib/blob/master/lib/phonelib/phone_analyzer_helper.rb#L12
I was wondering why you do this and/or if there's a way to get a list of all countries where the number is valid*?
Thanks in advance and best!
.countries
but it returned only one (the guessed) country.The text was updated successfully, but these errors were encountered: