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

feat: add warning when int value is too large during upload #591

Merged
merged 9 commits into from
Feb 27, 2020

Conversation

AVaksman
Copy link
Contributor

  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Towards #588

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 18, 2020
@AVaksman AVaksman changed the title feat: add warning on when int value is too large during upload feat: add warning when int value is too large during upload Feb 18, 2020
src/entity.ts Outdated
@@ -580,6 +580,15 @@ export namespace entity {

if (typeof value === 'number') {
if (value % 1 === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the purpose of value % 1, this seems like it could use a comment (even though it wasn't added by you).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Would it be preferable to do

if (Number.isInteger(value)) {
...
}

instead? Here the method's name speaks for itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

the method name is nice 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Swapped the logic toNumber.isInteger(value)

@AVaksman AVaksman added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 21, 2020
src/entity.ts Outdated Show resolved Hide resolved
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 21, 2020
@stephenplusplus
Copy link
Contributor

LGTM!

@stephenplusplus stephenplusplus merged commit 5a4821b into googleapis:master Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants