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

fix(toFloat): verify the string can be safely converted to a float #1227

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

peterdemartini
Copy link
Contributor

@peterdemartini peterdemartini commented Jan 6, 2020

Verify the string can be safely converted to a float. This is needed because parseFloat('2020-01-06T14:31:00.135Z') will return 2020, even though it should return NaN. This fixes an issue checking isDivisibleBy('2020-01-06T14:31:00.135Z', 2).

Resolves #1226

Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

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

Generally looks good -- but please unstage all the unrelated changes in the other files.

…alidatorjs#1226)

This is needed because parseFloat('2020-01-06T14:31:00.135Z') will return 2020, even though it should return NaN. This fixes an issue checking isDivisibleBy('2020-01-06T14:31:00.135Z', 2).
@peterdemartini
Copy link
Contributor Author

Generally looks good -- but please unstage all the unrelated changes in the other files.

I removed the build files that got autogenerated

Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! 🎉

@profnandaa profnandaa merged commit 13d7045 into validatorjs:master Jan 9, 2020
Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

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

r/c'd by mistake. PR was good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isDivisibleBy string comparison inconsistent
2 participants