Skip to content

feat(isMobilePhone): add Brunei phone validation (#1761)#2704

Open
lrg913427-dot wants to merge 1 commit intovalidatorjs:masterfrom
lrg913427-dot:feat/add-brunei-mobile-validation
Open

feat(isMobilePhone): add Brunei phone validation (#1761)#2704
lrg913427-dot wants to merge 1 commit intovalidatorjs:masterfrom
lrg913427-dot:feat/add-brunei-mobile-validation

Conversation

@lrg913427-dot
Copy link
Copy Markdown

Description

This PR adds mobile phone validation for Brunei (locale: ms-BN, country code: +673) to address issue #1761.

Changes

  • src/lib/isMobilePhone.js: Added regex pattern ^(\+?673)?[78]\d{6}$ for ms-BN locale
  • test/validators.test.js: Added test cases with valid and invalid phone numbers for Brunei
  • README.md: Added ms-BN to the locale list for isMobilePhone

Phone number format

  • Country code: +673
  • Mobile numbers start with 7 or 8, followed by 6 digits
  • Valid examples: +6737123456, 7123456, 8123456

Testing

All 318 tests pass with 100% statement and line coverage.

Fixes #1761

Add mobile phone validation for Brunei (ms-BN) with country code +673.
Mobile numbers in Brunei start with 7 or 8 followed by 6 digits.

- Add regex pattern to src/lib/isMobilePhone.js
- Add test cases in test/validators.test.js
- Update README.md locale list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile Phone validations - For The First Time Contributors

1 participant