0.0.3 • Published 7 years ago
rf-phone-validator v0.0.3
rf-phone-validator
Clean, normalize, validate and format Russian Federation phone numbers.
Install
npm install --save rf-phone-validatorUsage
const PhoneValidator = require('rf-phone-validator');
const phone = new PhoneValidator('8 000 123-4567');Allowed any phone format.
clean()
console.log(phone.clean()); // 80001234567normalize()
console.log(phone.normalize()); // 70001234567valid()
Return true if U can call phone otherwise false
format()
Format phone to the classic '+7 (000) 123-45-67'
formatSpaces()
Format phone to the spases-delimiter '+7 000 123 45 67'