Add more postcode countries: India, Germany, Australia
I maintainer di solito rispondono entro 1 giorno
@mohsin-usmani ci sta già lavorando.
Dal 4/12/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 0
- Fork
- 7
- Merge medio
- 1h 17m
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aniru-dh21/snap-validate
-
Use one constant for the 10,000-character input limitForse già presa @NginxL l’ha presa oggi. Apertagood first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aniru-dh21/snap-validate#51 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
aniru-dh21/snap-validate#40 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
aniru-dh21/snap-validate#35 ·
I maintainer di solito rispondono entro 1 giorno
-
Raise test coverage of `BaseValidator`Forse già presa @sumitkhond111-del l’ha presa oggi. Apertagood first issue tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
aniru-dh21/snap-validate#44 ·
I maintainer di solito rispondono entro 1 giorno
-
Unknown country or format codes silently fall back to defaultsForse già presa @sumitkhond111-del l’ha presa oggi. Apertadiscussion enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
aniru-dh21/snap-validate#37 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aniru-dh21/snap-validate
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
from-review tech-debt testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
blamechris/chroxy#9520 ·
I maintainer di solito rispondono entro 1 giorno
-
Documentation pleaseAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
area/host bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Fei2411/DeepSeek-Bot#3190 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
freelawproject/litigant-portal#1307 ·
I maintainer di solito rispondono entro 2 giorni