wajatimur / node-phonenumber

Google's phone number handling library ported to Node
33 stars 5 forks source link

phoneUtil.isValidNumbe retured an error for number "917888042551" #17

Closed doronalon closed 8 years ago

doronalon commented 8 years ago

phoneUtil.isValidNumbe returnred an error for number "917888042551"

The number "917888042551" seem as valid according "https://rawgit.com/googlei18n/libphonenumber/master/javascript/i18n/phonenumbers/demo-compiled.html" but the function "phoneUtil.isValidNumber" returned an error

var phone = require('node-phonenumber')

var phoneUtil = phone.PhoneNumberUtil.getInstance(); potentialPhoneNumber = phoneUtil.parse('917888042551', 'IN'); if (phoneUtil.isValidNumber(potentialPhoneNumber)) {

    result = potentialPhoneNumber
    console.log(JSON.stringify(potentialPhoneNumber));
   } else {
       error = new Error('Invalid number');
       console.log(error);

                }
wajatimur commented 8 years ago

Ok, will have a look at it.

wajatimur commented 8 years ago

Can you try again with latest version v0.2.4, it seems pass the test.

doronalon commented 8 years ago

Thanks, with v0.2.4 it's working...

wajatimur commented 8 years ago

Welcome, good to hear that. Please ping me at twitter @azrijamil if got any urgent request.