US phone numbers not passing validation
See original GitHub issueI’m using chance to build stubs for test cases, and I’m using chance to generate fake user phone numbers. However, I also validate this using libphonenumber and can’t seem to get it to accept any of the numbers generated by chance.phone({country: 'us'})
. I also tried using phone and that only accepts half of them. Any idea why this would be?
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:13 (6 by maintainers)
Top Results From Across the Web
4.2. Validate and Format North American Phone Numbers
Problem. You want to determine whether a user entered a North American phone number, including the local area code, in a common format....
Read more >Phone Number Validation: Verify Numbers in 3 Seconds
Use our easy-to-use phone number verification tool to expand your contact database and validate phone numbers before you reach out to customers.
Read more >US Phone Number Verification - Stack Overflow
If your purpose is to guard against mis-entered phone numbers, then you can probably catch well over 90% of them with just a...
Read more >Phone Validator ✔️ | Is it a Cell or is it a Landline?
Free phone number validation provided by PhoneValidator.com. Check phone numbers to verify if cell phone, landline, VOIP, toll-free or fake.
Read more >Bad Practices on Phone Number Form Fields - UX Movement
Your users should not wonder which phone number format is valid or get a validation error for the wrong phone number format.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@akre54 my use case is that I have automatic validators in my ORM that format and validate phone numbers before saving. without a valid phone number, none of my test data will save.
+1 also for UK numbers it’s breaking - my work around is while looping it until I get a valid number 😦 - the correct solution would be to use libphonenumberjs