src/phonelib.js
function isValid(number, countryCode) {
    try {
        var phoneUtil = i18n.phonenumbers.PhoneNumberUtil.getInstance();
        var numberObj = phoneUtil.parseAndKeepRawInput(number, countryCode);
        return phoneUtil.isValidNumber(numberObj);
    } catch (e) {
        return false;
    }
}
function isValid(number, countryCode) {
    try {
        var phoneUtil = i18n.phonenumbers.PhoneNumberUtil.getInstance();
        var numberObj = phoneUtil.parseAndKeepRawInput(number, countryCode);
        return phoneUtil.isValidNumber(numberObj);
    } catch (e) {
        return false;
    }
}
function isValid ( number , countryCode ) { try { var phoneUtil = i18n . phonenumbers . PhoneNumberUtil . getInstance ( ) ; var numberObj = phoneUtil . parseAndKeepRawInput ( number , countryCode ) ; return phoneUtil . isValidNumber ( numberObj ) ; } catch ( e ) { return false ; } }
check if given number is valid
check if given number is valid