Skip to content

feat(isPostalCode): add BD locale #2551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tanvirrb
Copy link
Contributor

@tanvirrb tanvirrb commented Apr 9, 2025

This pull request includes updates to the README.md documentation, the isPostalCode validation logic, and the associated tests to add support for Bangladeshi postal codes.

Documentation update:

  • README.md: Added 'BD' (Bangladesh) to the list of supported locales for the isPostalCode function.

Validation logic update:

  • src/lib/isPostalCode.js: Added a new regular expression pattern for Bangladeshi postal codes to the patterns object.

Test update:

  • test/validators.test.js: Added test cases for Bangladeshi postal codes, including both valid and invalid examples.

Reference: Bangladehi postal code list in Wikipedia

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (bdb8f9e) to head (50765f8).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2551   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2535      2535           
  Branches       641       641           
=========================================
  Hits          2535      2535           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WikiRik WikiRik changed the title Add Bangladeshi postal code feat(isPostalCode): add BD locale Apr 9, 2025
WikiRik
WikiRik previously approved these changes Apr 9, 2025
Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a small suggestion to simplify the regex

@WikiRik WikiRik requested a review from rubiin April 10, 2025 16:59
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.

2 participants