-
-
Notifications
You must be signed in to change notification settings - Fork 1k
test: add check for const number #3538
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
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3538 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 2880 2880
Lines 220510 220510
Branches 952 951 -1
=======================================
+ Hits 220455 220457 +2
+ Misses 55 53 -2 🚀 New features to boost your workflow:
|
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.
I get why this is happening and why the extra test works "as expected" - but doesn't that basically mean that the const
in the maybe()
generic is basically doing nothing.
faker/src/modules/helpers/index.ts
Line 767 in b174135
maybe<const TResult>( |
From my understanding the const
clause (don't know if that is the right term) can never be meat in this specific scenario.
it has a different behavior for e.g. arrays |
61a680b
to
0b274a2
Compare
That's true. But I'm talking about this specific case. The generic is inferring a return type of a function that is passed in. The function itself could be inferred as |
Anyways, my question was regarding the implementation of the |
There was just a confusion about how TS works, so I added a second test to clarify the difference and resolved the TODO