v1.1.7 formatPhone with local & int'l option
const { formatPhone, checkOperator, isValid } = require('phone-formater-eth');
- Included another parametet for formatPhone method with type ("local" | "international") by default it's "international"
console.log(formatPhone('0912345678')); // Outputs: +251912345678 - international format console.log(formatPhone('+251712345678',"local")); // Outputs: 0712345678
- isValid - Checks if phone number is valid or not
console.log(isValid('251912345678')); // Outputs: true console.log(isValid('0812345678')); // Outputs: fals