chriso/node-validator — pull request #39 by ctavan (2011-10-27 19:26:20+00:00)
Title: Improved isDecimal and isInt validations

I added these two patches by @MaVo159 since I think isDecimal should

- Disallow empty strings
- Allow leading zeros like 01.123
- Allow scientific notation like 2.2250738585072011e-308

and isInt should

- Allow leading zeros like 01
- Allow just zeros like 000

We also discovered an error in the test-suite: Basically all checks for failing values are useless, since they are entirely wrapped in a try catch block which means that also the exceptions raised by `assert.ok(false)` are always caught which results in none of these exceptions ever showing up.

We have fixed that for the isDecimal and isInt tests, see https://github.com/ctavan/node-validator/commit/b11c5229777281ee50bb7a25cd079e0f3759790a#L1R229

Do you think you might fix the remaining tests at some point?

Cheers,
Christoph