1.0.2 • Published 4 years ago
br-phone-validator-lib v1.0.2
Br-Phone-Validator-Lib
Cell number and fixed phone number validator
Valid for these formats:
`(xx) xxxxx-xxxx` or
`(xx) xxxx-xxxx` or
`xxxxxxxxxxx` or
`xxxxxxxxxx` or
Install
npm i br-phone-validator-lib
Usage
import PhoneBrValidator from 'br-phone-validator-lib'
PhoneBrValidator.isPhone('(79) 99212-2212') // return true
PhoneBrValidator.isPhone('(79) 9212-2212') // return false because first number after DDD in number fixed should not is 0 or 1 or 9
PhoneBrValidator.isPhone('(79) 3212-2212') // return true
PhoneBrValidator.isPhone('79992122212') // return true
PhoneBrValidator.isPhone('7992122212') // return false because first number after DDD in number fixed should not is 0 or 1 or 9
PhoneBrValidator.isPhone('7932122212') // return true