Comments (5)
I just run the test.
I think the expect result should be like this:
phone('+1905-555-1234', '')
[ '+19055551234', 'CAN' ]
As 905
is a CAN prefix, not USA.
if you didn't provide +1
, as the country prefix, it will treat it as USA, and 905 is NOT USA, so it give you empty.
May be we should do one more improvement, if USA is not match, we should try USA
from phone.
Also experiencing this with area code 819. This library behaves incorrectly with Canadian phone numbers that have country code 1.
from phone.
Can you make CAN and USA be treated the same, regardless of the +1? It doesnt make sense for canadian users to have to type +1, but not US users. Thanks!
from phone.
Same issue:
phone("866-454-8855") // []
phone("+1-866-454-8855") // []
from phone.
version 2.3.11 resolved this issue by adding CAN as default country together with USA, thanks for the information
from phone.
Related Issues (20)
- New Oklahoma City area code is considered invalid HOT 1
- [Bug/ problem report] Missing city code '672' of Canada HOT 1
- Missing format mobile_begin_with of Belgium HOT 1
- [Problem] phone number with country field can't recognize without starting with + HOT 4
- Zambian phone numbers starting with 7 are not supported HOT 2
- [Bug/ problem report] Brazilian numbers can also have 10 digits HOT 5
- Format for Somalia is out of date. HOT 2
- mobile number in Fiji can also start with 8 or 2 now
- when i use phone('8999525900', 'IDN') i get error HOT 1
- Lebanon Phone Number returns invalid HOT 8
- phone returns valid for string with extra characters in front HOT 1
- Canadian mobile number marked as invalid HOT 1
- Swiss fixed phone numbers marked as invalid HOT 3
- Support for Curaçao HOT 6
- US mobile_begin_wit has duplicated code HOT 3
- Austrailian phone number failing validation HOT 1
- Can't get strictDetection to work as intended HOT 2
- New area codes 656 and 771 HOT 6
- Valid Dutch numbers fails verification HOT 3
- Encountered some invalid phone numbers, please troubleshoot HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phone.