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(helpers): introduce allowHuge flag #3256

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Nov 10, 2024

Second part of #2695


Adds a allowHuge flag to faker.helpers.multiple. If not set, the number of elements is limited to < 1 Mio.
I considered lowering the limit to just 100k as even 1 Mio elements take quite the while to generate.

Once this PR is accepted I'll continue with the string and lorem(?) module.

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs m: helpers Something is referring to the helpers module labels Nov 10, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Nov 10, 2024
@ST-DDT ST-DDT requested review from a team November 10, 2024 20:06
@ST-DDT ST-DDT self-assigned this Nov 10, 2024
Copy link

netlify bot commented Nov 10, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit 1ad9349
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/673112e074896d0008ce4c41
😎 Deploy Preview https://deploy-preview-3256.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.

@ST-DDT ST-DDT linked an issue Nov 10, 2024 that may be closed by this pull request
10 tasks
Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (4df0bed) to head (1ad9349).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3256      +/-   ##
==========================================
- Coverage   99.96%   99.96%   -0.01%     
==========================================
  Files        2805     2806       +1     
  Lines      217115   217130      +15     
  Branches      976      976              
==========================================
+ Hits       217049   217051       +2     
- Misses         66       79      +13     
Files with missing lines Coverage Δ
src/internal/check-huge.ts 100.00% <100.00%> (ø)
src/modules/helpers/index.ts 96.73% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

@matthewmayer
Copy link
Contributor

Should this maybe just be a warning rather than an error?

@ST-DDT
Copy link
Member Author

ST-DDT commented Nov 11, 2024

Should this maybe just be a warning rather than an error?

For now, I opted for an error as there is a strong connection between the error and the call location. A warning just appears in the log and needs extra context for assiciating it with the source.
It is just a suggestion to resolve the linked issue at this point and nothing final.

If the others think, this should be a warning or should (not) be there at all. I would like to hear about it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs m: helpers Something is referring to the helpers module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve DX for methods that use all memory
2 participants