Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(location): allow postcode_by_state to take an array of patterns #3170

Merged
merged 3 commits into from
Oct 13, 2024

Conversation

matthewmayer
Copy link
Contributor

ref #3169

This change will make it easier to handle ZIP codes where there are "holes" in the ranges.

For example Hawaii could use two ranges like this to exclude 96799 (American Samoa)

HI: [
    '{{number.int({"min": 96701,"max": 96798})}}',
    '{{number.int({"min": 96801,"max": 96898})}}',
  ],

Since faker.helpers.fake accepts an array, just need to change the type. Will change the actual definitions in a followup PR.

@matthewmayer matthewmayer requested a review from a team as a code owner October 11, 2024 01:22
Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit dfab837
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/670bd83c2b43df0008c7c503
😎 Deploy Preview https://deploy-preview-3170.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (a8dfa2f) to head (dfab837).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3170      +/-   ##
==========================================
- Coverage   99.97%   99.96%   -0.01%     
==========================================
  Files        2798     2798              
  Lines      227808   227808              
  Branches      580      955     +375     
==========================================
- Hits       227748   227733      -15     
- Misses         60       75      +15     
Files with missing lines Coverage Δ
src/definitions/location.ts 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@ST-DDT ST-DDT changed the title refactor(location): Allow postcode_by_state to take an array of patterns refactor(location): allow postcode_by_state to take an array of patterns Oct 11, 2024
@xDivisionByZerox xDivisionByZerox added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs c: locale Permutes locale definitions m: location Something is referring to the location module labels Oct 12, 2024
Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

Sounds reasonable. Would we change the definition property type to only string[] in v10?

@ST-DDT
Copy link
Member

ST-DDT commented Oct 12, 2024

I'd prefer using actual code instead of string patterns for v10.

@ST-DDT ST-DDT requested review from a team October 12, 2024 17:59
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 12, 2024
@ST-DDT ST-DDT enabled auto-merge (squash) October 13, 2024 14:24
@ST-DDT ST-DDT merged commit 522e738 into faker-js:next Oct 13, 2024
21 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 c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs 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