-
-
Notifications
You must be signed in to change notification settings - Fork 929
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: reimplement datatype.bigInt #791
Conversation
Codecov Report
@@ Coverage Diff @@
## main #791 +/- ##
=======================================
Coverage 99.67% 99.67%
=======================================
Files 2110 2110
Lines 225693 225732 +39
Branches 971 979 +8
=======================================
+ Hits 224950 224992 +42
+ Misses 723 720 -3
Partials 20 20
|
Please also add a test, that uses min:0, max: 1000000000000 (it is important that these are 1 and then only zeros, as these are harder to "find" for some implementations (e.g. loop based ones). 00-99 => 100% (100/100) success rate |
Awaiting other PRs like #797 to be done |
8f04b48
to
a77f218
Compare
a77f218
to
ae7752a
Compare
bebd2a8
to
5f7e874
Compare
2593c87
to
9d6eec5
Compare
9edd2fb
to
633f857
Compare
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
d7048cc
to
46bf568
Compare
max = BigInt(options.max ?? min + BigInt(999999999999999)); | ||
} else { | ||
min = BigInt(0); | ||
max = BigInt(options ?? 999999999999999); |
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.
Why can you pass options
directly here? MDN documentation states that the value can "May be a string or an integer". So why the boolean
or the object?
I've never worked with BigInt so sorry if this makes no sense.
bigInt( | ||
options?: | ||
| bigint | ||
| boolean |
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.
What would faker.datatype.bigInt(false)
return? I don't understand what advantage we have from accepting a boolean parameter.
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.
Depends on #797