Add more postcode countries: India, Germany, Australia
Maintainers usually reply within 1 day
@mohsin-usmani is already working on this.
Since Dec 4, 2026.
Assessment
This issue has not been assessed yet.
Description
zipCode() supports us, ca and uk. Adding a country is a contained change that touches every layer of the library, so it's a good way to learn the codebase.
Status
-
in: India, taken by @Rewaskc02-lang -
de: Germany, taken by @mohsin-usmani -
au: Australia, open
One country per pull request is fine. Comment saying which one you're taking.
Suggested formats
Please double-check each against an official source and link it in your pull request.
in: India PIN code, 6 digits, not starting with 0 (/^[1-9]\d{5}$/)de: Germany, 5 digits. Leading zeros are valid (e.g.01067Dresden)au: Australia, 4 digits. Leading zeros are valid, since Northern Territory codes start with 0 (e.g.0800Darwin), so don't use[1-9]
Use lowercase codes (in, de, au) to match the existing us, ca and uk.
Files to touch
src/validators/zipCode.js: add the regextypes/index.d.ts: add the code toCountryCodetest-types.ts: add a line using the new codetests/validators.test.js: valid and invalid examplessite/main.js: add it to the playground's Country dropdown and topostcodeSamples- README: "Zip Code Validation"
Heads-up on tests:
zipCode()falls back to the US regex for unknown country codes (zipRegex[country] || zipRegex.us). Include at least one case where the new country and the US disagree, so the test fails without your change (e.g.'12345-6789'invalid forde,'2000'valid forau).
Done when
- All of the above, and
npm test,npm run type-checkandnpm run sizepass
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 7
- Avg merge
- 1h 17m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aniru-dh21/snap-validate
-
Use one constant for the 10,000-character input limitPossibly taken @NginxL claimed this today. Opengood first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aniru-dh21/snap-validate#51 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aniru-dh21/snap-validate#40 ·
Maintainers usually reply within 1 day
-
good first issue tests
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
aniru-dh21/snap-validate#35 ·
Maintainers usually reply within 1 day
-
Raise test coverage of `BaseValidator`Possibly taken @sumitkhond111-del claimed this today. Opengood first issue tests
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
aniru-dh21/snap-validate#44 ·
Maintainers usually reply within 1 day
-
Unknown country or format codes silently fall back to defaultsPossibly taken @sumitkhond111-del claimed this today. Opendiscussion enhancement
Difficulty 4/5 3-5 days Newbie friendliness 25/100
aniru-dh21/snap-validate#37 ·
Maintainers usually reply within 1 day
All issues in aniru-dh21/snap-validate
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
from-review tech-debt testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
blamechris/chroxy#9520 ·
Maintainers usually reply within 1 day
-
Documentation pleaseOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area/host bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fei2411/DeepSeek-Bot#3190 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days