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

refactor: datatype number #798

Merged
merged 9 commits into from
Apr 8, 2022
Merged

refactor: datatype number #798

merged 9 commits into from
Apr 8, 2022

Conversation

Shinigami92
Copy link
Member

No description provided.

@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs labels Apr 7, 2022
@Shinigami92 Shinigami92 added this to the v6.2 - New small features milestone Apr 7, 2022
@Shinigami92 Shinigami92 self-assigned this Apr 7, 2022
@codecov
Copy link

codecov bot commented Apr 7, 2022

Codecov Report

Merging #798 (1e9d211) into main (0dfe9a3) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 1e9d211 differs from pull request most recent head 921a451. Consider uploading reports for the commit 921a451 to get more accurate results

@@            Coverage Diff             @@
##             main     #798      +/-   ##
==========================================
- Coverage   99.35%   99.34%   -0.01%     
==========================================
  Files        1921     1921              
  Lines      179086   177121    -1965     
  Branches      909      907       -2     
==========================================
- Hits       177934   175968    -1966     
- Misses       1096     1097       +1     
  Partials       56       56              
Impacted Files Coverage Δ
src/datatype.ts 100.00% <100.00%> (ø)
src/utils/user-agent.ts 97.84% <0.00%> (-0.27%) ⬇️
src/lorem.ts 100.00% <0.00%> (ø)
src/company.ts 100.00% <0.00%> (ø)
src/internet.ts 100.00% <0.00%> (ø)
src/locales/en/system/mimeTypes.ts 100.00% <0.00%> (ø)
src/system.ts 96.46% <0.00%> (+0.05%) ⬆️

@Shinigami92 Shinigami92 marked this pull request as ready for review April 7, 2022 12:05
@Shinigami92 Shinigami92 requested a review from a team as a code owner April 7, 2022 12:05
@Shinigami92 Shinigami92 requested review from ST-DDT and a team April 7, 2022 12:05
@Shinigami92 Shinigami92 mentioned this pull request Apr 7, 2022
@ST-DDT ST-DDT requested a review from a team April 7, 2022 12:18
src/datatype.ts Outdated Show resolved Hide resolved
@Shinigami92 Shinigami92 requested a review from a team April 7, 2022 12:50
Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above.

@Shinigami92 Shinigami92 requested review from ST-DDT, pkuczynski and a team April 7, 2022 14:54
Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you want to fix this here, but there is a bug in this method for negative numbers.

faker.datatype.number({ min: -5, max: -4 })

never generates -4 due to the if being there (should always apply)

if (max >= 0) {

As an alternative you could just remove the if and its body and add +1 to the max side of the mersenne.rand() call. That way max could be a const as well.

src/datatype.ts Outdated Show resolved Hide resolved
@Shinigami92 Shinigami92 marked this pull request as draft April 7, 2022 15:28
@Shinigami92 Shinigami92 requested a review from ST-DDT April 8, 2022 13:21
@Shinigami92 Shinigami92 marked this pull request as ready for review April 8, 2022 13:21
@Shinigami92 Shinigami92 requested a review from a team April 8, 2022 13:21
@ST-DDT ST-DDT requested a review from a team April 8, 2022 15:19
@Shinigami92 Shinigami92 enabled auto-merge (squash) April 8, 2022 20:14
@Shinigami92 Shinigami92 merged commit 651d684 into main Apr 8, 2022
@ST-DDT ST-DDT deleted the refactor-datatype-number branch April 26, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants