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

feat: add initial seed parameter to constructors #3220

Merged
merged 15 commits into from
Nov 12, 2024
Merged

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 24, 2024

Fixes #3008


Adds the ability to add the seed directly to the constructor:

const customFaker = new SimpleFaker({ seed: 123 });

instead of

const customFaker = new SimpleFaker();
customFaker.seed(123);

Documentation:

@ST-DDT ST-DDT added c: feature Request for new feature p: 1-normal Nothing urgent labels Oct 24, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 24, 2024
@ST-DDT ST-DDT requested review from a team October 24, 2024 23:05
@ST-DDT ST-DDT self-assigned this Oct 24, 2024
Copy link

netlify bot commented Oct 24, 2024

Deploy Preview for fakerjs failed.

Name Link
🔨 Latest commit 8bc22d6
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/67330e9f2104bb0008419b38

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (cb4b77c) to head (8bc22d6).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3220      +/-   ##
==========================================
- Coverage   99.97%   99.96%   -0.01%     
==========================================
  Files        2805     2806       +1     
  Lines      217136   217144       +8     
  Branches      977      980       +3     
==========================================
- Hits       217071   217064       -7     
- Misses         65       80      +15     
Files with missing lines Coverage Δ
src/faker.ts 100.00% <100.00%> (ø)
src/internal/seed.ts 100.00% <100.00%> (ø)
src/simple-faker.ts 100.00% <100.00%> (ø)
src/utils/mersenne.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@ST-DDT ST-DDT requested review from xDivisionByZerox and a team October 26, 2024 02:04
src/simple-faker.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT enabled auto-merge (squash) November 12, 2024 08:15
@ST-DDT ST-DDT merged commit 1633c8d into next Nov 12, 2024
19 of 23 checks passed
@ST-DDT ST-DDT deleted the feat/initial-seed branch November 12, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Faker to Take Initial Seed on Construction
2 participants