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

isDecimal Incorrectly Returns true For undefined, null, NaN and empty strings #419

Closed
ptrckc opened this issue Aug 4, 2015 · 0 comments
Closed

Comments

@ptrckc
Copy link

ptrckc commented Aug 4, 2015

The regex for isDecimal incorrectly results in true for an empty string. Since your toString function transforms null, undefined and NaN values to empty strings, these also result in a returned value of true. You should check for str !== '' before testing the regex like you do in isFloat.

@chriso chriso closed this as completed in 6f83606 Aug 4, 2015
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

No branches or pull requests

1 participant