UNPKG

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

Version:
13 lines (12 loc) 414 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const regexps = { false: /^1[356789]\d{8}$/, true: /^\+?8801[356789]\d{8}$/, undefined: /^(\+?88)?01[356789]\d{8}$/ }; function isMobilePhoneNumberBd(mobilePhoneNumber, withCountryCode) { const regex = regexps[String(withCountryCode)]; return regex.test(mobilePhoneNumber); } exports.default = isMobilePhoneNumberBd;