Problem with Valid SG mobile numbers returning No Type (as of 1.6.0)
See original GitHub issueI have a case where a given number is returning no Type, whereas the same number in Google’s library (and other online checkers) correctly returns type “MOBILE”. This case works in libphonenumber-js versions prior to 1.6.0 (using older API - tested with 1.5.2), but anything later than 1.6.0 inclusive fails.
The number is +6584655555 (last 5 digits changed for privacy). I use Default Country “AU” (as that’s where I am, and most of our user). The library correctly identifies it as a Valid number from country “SG” - but the type is undefined.
Google Test: https://libphonenumber.appspot.com/phonenumberparser?number=%2B6584655555&country=AU
I have tried using “metadata.full.json” - although normally I use “metadata.mobile.json”.
Minimal script:
const PhoneUtil = require('libphonenumber-js')
const metadata = require('libphonenumber-js/metadata.full.json')
let number = PhoneUtil.parsePhoneNumberFromString('+6584685555', 'AU', metadata)
let type = number.getType(number)
console.log({number, type})
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Libphonenumber-getexample NPM - npm.io
Returns phone number type (fixed line, mobile, toll free, etc) or undefined (if the number is invalid or if there are no phone...
Read more >Phone number validation Android - Stack Overflow
Use isGlobalPhoneNumber() method of PhoneNumberUtils to detect whether a number is valid phone number or not. Example. System.out.println("....g1.
Read more >Voice JavaScript SDK: Changelog - Twilio
Changelog for the Voice JavaScript SDK including new features, bug fixes and updates.
Read more >Bug listing with status RESOLVED with resolution TEST ...
Error in sched.c line 961. ... Bug:40322 - "sys-apps/man creates /var/cache/man/cat* directories without write permission for man group" status:RESOLVED ...
Read more >tMo - River Thames Conditions - Environment Agency - GOV.UK
#in Share video google drive, Cafe keko duisburg, Auspost tracking number digits, ... Mobile roadworthy melbourne, Baja mali knindza 2016, Nike employee ...
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
@Dortamur Oh, I get it now: you’re importing from the wrong package. See readme on
min
vsmax
vsmobile
.Great! Thanks.