npm.io
1.0.2 • Published 6 years ago

br-phone-validator-lib

Licence
MIT
Version
1.0.2
Deps
0
Size
8 kB
Vulns
0
Weekly
0

Br-Phone-Validator-Lib

Cell number and fixed phone number validator

Build Status


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

Keywords