Skip to content

fix(locale): only generate valid postcode formats for sk - #4257

Merged
ST-DDT merged 1 commit into
faker-js:nextfrom
simonkundrik:fix/sk-postcode-format
Nov 6, 2026
Merged

ST-DDT merged 1 commit into
faker-js:nextfrom
simonkundrik:fix/sk-postcode-format

Conversation

@simonkundrik

Copy link
Copy Markdown
Contributor

The sk postcode patterns were #####, ### ## and ## ###. Slovak postal codes have five digits, written as XXX XX (for example 811 01 for Bratislava) or without the space. So ## ### gave results like 15 891, which is not a Slovak postcode, and that is one in three results of fakerSK.location.zipCode(). See https://en.wikipedia.org/wiki/Postal_codes_in_Slovakia

I 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.

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.
@simonkundrik
simonkundrik requested a review from a team as a code owner November 5, 2026 12:57
@netlify

netlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fakerjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 45f2cf3
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/6aec7d36b10aff29aa1de4a1
😎 Deploy Preview https://deploy-preview-4257.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: locale Permutes locale definitions m: location Something is referring to the location module labels Nov 5, 2026
@ST-DDT ST-DDT added this to the v11.0 milestone Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (070ac23) to head (45f2cf3).

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:
  • ❄️ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@ST-DDT
ST-DDT added this pull request to the merge queue Nov 6, 2026
Merged via the queue into faker-js:next with commit 756cfed Nov 6, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: locale Permutes locale definitions m: location Something is referring to the location module p: 1-normal Nothing urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants