Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
validate(value: string) {
if (!new PhoneValidator(`+${value}`).isValid()) return false;
return true;
}
}
const phoneUri = value =>
new PhoneNumber(value, dialCode).getNumber('rfc3966') || `tel:${value}`;
const phoneNumber = value =>
new PhoneNumber(value, inputs.dialCode.value).getNumber('national') ||
value;
phoneNumber => new PhoneNumber(phoneNumber).isValid()
]
normalize(data: any) {
const phoneNumber = new PhoneValidator(`+${data}`);
const fullNumber = phoneNumber.getNumber();
if (fullNumber) return String(fullNumber).slice(1);
throw Error('could not normalize');
}