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

/br-phone-validator-lib/

    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