0.0.3 • Published 5 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-validator
Usage
const PhoneValidator = require('rf-phone-validator');
const phone = new PhoneValidator('8 000 123-4567');
Allowed any phone format.
clean()
console.log(phone.clean()); // 80001234567
normalize()
console.log(phone.normalize()); // 70001234567
valid()
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'