Comments (9)
How do you expect a national number 233111111111
in international to be +233111111111
.
That's nonsense
from libphonenumber-js.
233 - is country code, so I expect International phone format in, this case should be like
+233111111111 (the same as google-libphonenumber)
not
+233 233111111111 (current behavior)
from libphonenumber-js.
Show me "same as google-libphonenumber" in the google-libphonenumber demo
from libphonenumber-js.
https://libphonenumber.appspot.com/phonenumberparser?number=233111111111&country=GH
from libphonenumber-js.
And?
What's the international number on that page.
from libphonenumber-js.
ok, incorrect input, sorry
check out this link
https://libphonenumber.appspot.com/phonenumberparser?number=233244111111&country=GH
from libphonenumber-js.
import { format } from 'libphonenumber-js'
it('Ghana phone',()=>{
const phone = format('233244111111', 'GH', 'International')
expect(phone).toBe('+233244111111')
})
///-
Expected value to be (using ===):
"+233244111111"
Received:
"+233 233244111111"
from libphonenumber-js.
ok, while libphonenumber
parses 233244111111
as +233244111111
I don't see any reason for doing that because if the international standard states that there must be a +
sign then there must be a +
sign and I don't think it would be sane to try adding a +
sign manually just to check if an invalid phone number can be parsed as an international one.
from libphonenumber-js.
ok, no problem.
from libphonenumber-js.
Related Issues (20)
- isValid() and isValidPhoneNumber() return real phone number is invalid HOT 2
- Error [ERR_REQUIRE_ESM] on parsePhoneNumberFromString HOT 4
- parsePhoneNumberWithError() return isValid() === 'false' but not throw an error HOT 3
- Some HK mobile numbers (9291****) are not yet supported in this library HOT 1
- Belgium phone number are valid even if they can't be parsed for national display HOT 1
- When using AsYouType with US Country code, if number starts with 1 it formats incorrectly. HOT 1
- country code duplication for some countries HOT 2
- ParsePhoneNumber mistakes the two first digits as the country code HOT 1
- When editing a formatted number the cursor moves to the end HOT 1
- Get countryCode, countryName, countryFlag object HOT 4
- isValidPhoneNumber function return wrong result HOT 1
- +15575001171 number not validated as valid phone number when it is valid by Google's libphonenumber HOT 5
- isValidPhoneNumber and parsePhoneNumber validate the number incorrectly HOT 6
- Missing area code 861 HOT 1
- ts(1479) error in index.d.cts HOT 3
- Unable to delete characters if there is a parenthesis HOT 1
- Any property returns area code? HOT 3
- Different Results |ย Real Life vs Demo HOT 2
- validatePhoneNumberLength does not return TOO_LONG for invalid Ukrainian phone number HOT 9
- Some North American countries receive incorrect National Format when removing digits
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 libphonenumber-js.