Both of these functions are giving me true boolean value for 10 digit numbers which is not correct. For example it is giving me true value for this 8 (800) 555-3-35 which is incorrect. Also checked this with google-libphonenumber which gives false for this phonenumber.
import { isValidPhoneNumber ,parsePhoneNumber} from 'libphonenumber-js'
import phoneUtil from 'google-libphonenumber'
const ph = phoneUtil.PhoneNumberUtil.getInstance();
num = '8 (800) 555-3-35', country = 'RU'
const a = parsePhoneNumber(num,country) , b = ph.parseAndKeepRawInput(num,country)
Both of these functions are giving me true boolean value for 10 digit numbers which is not correct. For example it is giving me true value for this 8 (800) 555-3-35 which is incorrect. Also checked this with google-libphonenumber which gives false for this phonenumber.
import { isValidPhoneNumber ,parsePhoneNumber} from 'libphonenumber-js' import phoneUtil from 'google-libphonenumber' const ph = phoneUtil.PhoneNumberUtil.getInstance();
num = '8 (800) 555-3-35', country = 'RU'
const a = parsePhoneNumber(num,country) , b = ph.parseAndKeepRawInput(num,country)
console.log(a.isValid(), isValidPhoneNumber(num,country),ph.isValidNumber(b)) // true true false