0.1.1 • Published 6 years ago

@muniftanjim/is-mobile-phone-number-bd v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

isMobilePhoneNumberBd

Mobile phone number validator for Bangladesh

Usage

CommonJS

const isMobilePhoneNumberBd = require('@muniftanjim/is-mobile-phone-number-bd').default

ES Module

import isMobilePhoneNumberBd from '@muniftanjim/is-mobile-phone-number-bd'

Validation

isMobilePhoneNumberBd('+8801712345678') // true
isMobilePhoneNumberBd('8801712345678')  // true
isMobilePhoneNumberBd('01712345678')    // true
isMobilePhoneNumberBd('1712345678')     // false

Validation w/ CountryCode

const withCountryCode = true
isMobilePhoneNumberBd('+8801712345678', withCountryCode) // true
isMobilePhoneNumberBd('8801712345678', withCountryCode)  // true
isMobilePhoneNumberBd('01712345678', withCountryCode)    // false
isMobilePhoneNumberBd('1712345678', withCountryCode)     // false

Validation w/o CountryCode

const withCountryCode = false
isMobilePhoneNumberBd('+8801712345678', withCountryCode) // false
isMobilePhoneNumberBd('8801712345678', withCountryCode)  // false
isMobilePhoneNumberBd('01712345678', withCountryCode)    // false
isMobilePhoneNumberBd('1712345678', withCountryCode)     // true