Skip to content

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)

@codecov
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 (d91af4b) to head (c967337).
Report is 1 commits behind head on master.

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
@tanvirrb
Copy link
Contributor Author

Any update on this one?

@rubiin rubiin merged commit 8d58ecb into validatorjs:master May 13, 2025
10 checks passed
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.

3 participants