br-phone-validator-lib

1.0.2 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    18
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    18
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i br-phone-validator-lib

Weekly Downloads

19

Version

1.0.2

License

MIT

Unpacked Size

8.39 kB

Total Files

15

Last publish

Collaborators

  • idylicaro