-
-
Notifications
You must be signed in to change notification settings - Fork 883
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
fix: move utils to the correct place #2964
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2964 +/- ##
==========================================
- Coverage 99.96% 99.95% -0.02%
==========================================
Files 2984 2984
Lines 216057 216057
Branches 601 595 -6
==========================================
- Hits 215984 215957 -27
- Misses 73 100 +27
|
@watercubz Please also add a comment to the issue so that we can assign it to you for better visibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also move the
faker/src/internal/mersenne.ts
Line 333 in 05237e4
export function generateMersenne32Randomizer(): Randomizer { |
And the 53bit variant to src/utils/mersenne.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one. @ others: What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, if it doesn't convince you, let me change it and add the other requests you told me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one. @ others: What do you think?
From the issue:
External utilities [(
src/utils/*.ts
)] are not required to use a faker seed.
I believe we need to clarify our definition of "utilities." Is a type/interface always considered a utility, or only if it is generic? Is the Randomizer even a utility in the first place or a core building block of our library?
Additionally, I'd like to discuss the possibility of creating a separate directory, src/util/randomizer
. This directory could house the randomizer interface and specific randomizer adapters (e.g., mersenne, pure-rand, ...). If this question isn't directly related to the current topic, feel free to disregard it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the interface for Randomizer
should be exposed, because it is the return type of generate*Randomizer
.
So users can write const randomizer: Randomizer = generateMersenne32Randomizer();
I think |
Team Decision
|
Issue #2961: Move Functions and Types to Proper Directories
Changes Made
generateMersenne*Randomizers()
functions to thesrc/utils
directory.src/utils/types.ts
to thesrc/internal
directory.Additional Details
Screenshots
Attached screenshots showing the new directory structure and updated imports.
Related Issue