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

Misleading validator name for num.isNan #138

Open
gphfour opened this issue Jan 10, 2020 · 0 comments
Open

Misleading validator name for num.isNan #138

gphfour opened this issue Jan 10, 2020 · 0 comments

Comments

@gphfour
Copy link
Collaborator

gphfour commented Jan 10, 2020

Although there is a clear JSDoc explaining what this validator does, the name of the validator itself is misleading. I expect that it would check that a value is NaN, but it actually checks if a value is of type number. This means that all valid numbers (excluding NaN) will pass this check. I thing that this validator should be named num.isNumberType and there should be another validator which checks if the value is really NaN and it could be named num.isNaN. Will submit a PR.

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 a pull request may close this issue.

1 participant