Repository navigation
fix(locale): only generate valid postcode formats for sk - #4257
Merged
Merged
Conversation
Slovak postal codes have five digits, written as 'XXX XX' or without the space. The sk locale also had '## ###', so one in three zipCode() results grouped the digits as 2 and 3.
✅ Deploy Preview for fakerjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
ST-DDT
approved these changes
Nov 5, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #4257 +/- ##
=======================================
Coverage 99.14% 99.14%
=======================================
Files 1179 1179
Lines 3976 3976
Branches 723 723
=======================================
Hits 3942 3942
Misses 29 29
Partials 5 5 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the Slovak postcode format change.
No open issues 🎉
What changed in this PR
Corrects Slovak postcode generation in fakerSK.location.zipCode() by removing an invalid spacing pattern.
Changes:
- Removes
## ###, retaining the supported five-digit formats#####and### ##.
| File | Description |
|---|---|
src/locales/sk/location/postcode.ts |
Removes the invalid Slovak postcode pattern. |
Review effort: Balanced
Shinigami92
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
skpostcode patterns were#####,### ##and## ###. Slovak postal codes have five digits, written asXXX XX(for example811 01for Bratislava) or without the space. So## ###gave results like15 891, which is not a Slovak postcode, and that is one in three results offakerSK.location.zipCode(). See https://en.wikipedia.org/wiki/Postal_codes_in_SlovakiaI found it by running the zip codes of every locale through
validator.isPostalCode. This removes the pattern. I did not add a test because the allowed formats are already visible in the data file.