You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks much @albeebe for putting this together. Definitely saved me a lot of time.
Quick question: Is there any special reason why we are sanitizing the raw input of non numeric characters with the cleanPhone() method as opposed to just allowing libphonenumber to determine whether or not the phone number is valid?
One use case where allowing characters in the input would be useful is when you have a number like 1-800-CONTACT (1-800-266-8228) or 1-800-ASK-USPS (1-800-275-8777). Google's libphonenumber actually parses characters using the correct corresponding digit and let's you know if it is valid or not (both valid in this case).
The text was updated successfully, but these errors were encountered:
I want to start off by saying this is my first attempt at open sourcing. I basically built this to suit my own needs and someone said I should put it up on github. This code was initially thrown together for my own use, then I went through and cleaned it up when I put it on Github.
I don't exactly know off the top of my head why I sanitize the number. It may not be necessary. It's possible that libphonenumber required it to be sanitized in the past. I just don't know.
First, thanks much @albeebe for putting this together. Definitely saved me a lot of time.
Quick question: Is there any special reason why we are sanitizing the raw input of non numeric characters with the cleanPhone() method as opposed to just allowing libphonenumber to determine whether or not the phone number is valid?
One use case where allowing characters in the input would be useful is when you have a number like 1-800-CONTACT (1-800-266-8228) or 1-800-ASK-USPS (1-800-275-8777). Google's libphonenumber actually parses characters using the correct corresponding digit and let's you know if it is valid or not (both valid in this case).
Reply to this email directly or view it on GitHub: #8
First, thanks much @albeebe for putting this together. Definitely saved me a lot of time.
Quick question: Is there any special reason why we are sanitizing the raw input of non numeric characters with the
cleanPhone()
method as opposed to just allowing libphonenumber to determine whether or not the phone number is valid?One use case where allowing characters in the input would be useful is when you have a number like 1-800-CONTACT (1-800-266-8228) or 1-800-ASK-USPS (1-800-275-8777). Google's libphonenumber actually parses characters using the correct corresponding digit and let's you know if it is valid or not (both valid in this case).
The text was updated successfully, but these errors were encountered: