Skip to content

feat(isPostalCode): add NG locale - #2904

Open
Adeniyikayodee wants to merge 1 commit into
validatorjs:masterfrom
Adeniyikayodee:feat/ispostalcode-ng
Open

Adeniyikayodee wants to merge 1 commit into
validatorjs:masterfrom
Adeniyikayodee:feat/ispostalcode-ng

Conversation

@Adeniyikayodee

Copy link
Copy Markdown

Adds Nigeria to isPostalCode.

On 1 October 2026 Nigeria launched the National Digital Alphanumeric Postcode System (NDAPS), which gives every building an 11-character code: state (2 letters), LGA (2 digits, 01 to 99), district (3 letters or digits), area (2 letters), and building unit (2 digits, 01 to 99). It is written with hyphens (EK-01-A03-FK-01), with spaces (EK 01 A03 FK 01), or compact (EK01A03FK01), in either case.

The rule also accepts the six-digit postal code that came before it, which is still in circulation.

References

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

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9ff3424) to head (c2e8114).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2904   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2599      2599           
  Branches       658       658           
=========================================
  Hits          2599      2599           

☔ View full report in Codecov by Harness.
📢 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.

@Adeniyikayodee

Adeniyikayodee commented Oct 8, 2026 •

Copy link
Copy Markdown
Author

@rubiin @tux-tn, I would be grateful for your review of this whenever your time allows. It adds Nigeria to isPostalCode, covering the national postcode system the country launched on 1 October and the six-digit code that is still in circulation. Many teams and businesses building for Nigeria rely on validator.js, so I wanted to bring the rule here with care. The change is a single pattern with tests, and the references are in the description. Thank you for the work you both put into this library, and please take it at your own pace.

@Adeniyikayodee

Copy link
Copy Markdown
Author

@rubiin, I would be grateful if you could look at this whenever your time allows. Nigeria launched a new national postcode on 1 October, and isPostalCode has no NG locale yet. A great many projects rely on this library for validation, so I wanted to raise it here with care. The format and its source are in the description, and I am glad to help with anything that would make the review easier. Thank you for the work you put into this library, and please take it at your own pace.

@rubiin
rubiin requested review from WikiRik and tux-tn October 8, 2026 15:56
@Adeniyikayodee

Copy link
Copy Markdown
Author

@tux-tn, thank you @rubiin for the approval. I believe this needs a second review before it can merge. Would you be able to take a look when you have a moment? It is a single pattern with its tests, and all checks pass. I am glad to change anything that would help.

@Adeniyikayodee

Copy link
Copy Markdown
Author

@tux-tn, a gentle follow-up on this one. @rubiin has approved it, and I believe a second review is all it needs before it can merge. It is a single pattern with its tests, and all checks pass. Nigeria's new postcodes have been in use since 1 October, so I would be grateful if you could take a look whenever your time allows. Thank you for maintaining the library.

@Adeniyikayodee

Copy link
Copy Markdown
Author

@tux-tn @WikiRik, a short update in case it helps with review. Google updated the Nigeria entry in its address data today, using the same rule as this PR. The discussion is in google/libaddressinput#255, and the live data is at https://chromium-i18n.appspot.com/ssl-address/data/NG. Thank you for your time, and no rush.

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