fix: remove redundant precision from datatype.datetime options#335
Merged
Shinigami92 merged 3 commits intofaker-js:mainfrom Jan 30, 2022
Merged
fix: remove redundant precision from datatype.datetime options#335Shinigami92 merged 3 commits intofaker-js:mainfrom
Shinigami92 merged 3 commits intofaker-js:mainfrom
Conversation
ST-DDT
approved these changes
Jan 28, 2022
Member
|
#312 needs to be merged first (I know you know it, but just to be clear for other maintainers so they don't accidentally merge this 🙂) |
Member
|
@Shinigami92 Did you link the wrong PR? |
Member
Sorry, I think I loose the overview ... |
Member
Author
|
No worries! One step at the time :) |
Shinigami92
approved these changes
Jan 30, 2022
prisis
approved these changes
Jan 30, 2022
bmenant
pushed a commit
to bmenant/faker
that referenced
this pull request
Mar 11, 2022
demipel8
pushed a commit
to demipel8/faker
that referenced
this pull request
Mar 11, 2022
demipel8
pushed a commit
to demipel8/faker
that referenced
this pull request
Mar 11, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original DT types for this method looked like this:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b5bf4061b0811d2e16dc3c6b4c3c15881b73290f/types/faker/index.d.ts#L106-L107
When converting js to ts, it got accidentally typed taking all options of the
datatype.number, but usingprecisionhere makes no sense, as expected output should be aninteger.new Date()can handle floating numbers hereBut I think we should build the interface in a way, which makes more sense.
Additionally I made some changes in the code to prevent
precisionleaking intodatatype.number