@muniftanjim/is-mobile-phone-number-bd
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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

Package Sidebar

Install

npm i @muniftanjim/is-mobile-phone-number-bd

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

3.97 kB

Total Files

5

Last publish

Collaborators

  • muniftanjim