Closed tahseen0amin closed 6 months ago
Most likely you’re not using max metadata
On Sat, 3 Feb 2024 at 12:28, Tasin Zarkoob @.***> wrote:
I am getting NumberType as undefined for some of the following numbers:
- 9821121775 - IN
- 1234567899 - IN
But in the google libphonenumber return the correct Number Type.
https://libphonenumber.appspot.com/phonenumberparser?number=9821121775&country=IN
— Reply to this email directly, view it on GitHub https://github.com/catamphetamine/libphonenumber-js/issues/455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADUP35RFTVIAE7RZ4NHVVLYRX7NNAVCNFSM6AAAAABCX4DEC2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTMMZYGMZDGNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
How do we do that?
This is how I am using it
import { parsePhoneNumberWithError } from 'libphonenumber-js';
const phoneNumberObj = parsePhoneNumberWithError(
phoneNumber,
selectedCountryAbbr,
);
valid = phoneNumberObj.isValid();
const type = phoneNumberObj.getType();
if (type && type !== 'MOBILE') {
valid = false;
}
Where do I need to change that.
from 'libphonenumber-js/max'
Thanks.
Closing this issue.
I am getting NumberType as undefined for some of the following numbers:
But in the google libphonenumber return the correct Number Type. https://libphonenumber.appspot.com/phonenumberparser?number=9821121775&country=IN