Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't use Number constructor for number conversion

  • Loading branch information...
commit aed0725469e28b097e14ca7fe348a78ccf74346d 1 parent 57dd1ab
Christian Johansen authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  src/validators/max_val.js
  2. +1 −1  src/validators/min_val.js
View
2  src/validators/max_val.js
@@ -6,5 +6,5 @@
* @depends ../core/validator.js
*/
v2.Validator.reg('max-val', function(field, value, params) {
- return Number(value) <= Number(params[0]);
+ return +value <= params[0];
}, 'max');
View
2  src/validators/min_val.js
@@ -6,5 +6,5 @@
* @depends ../core/validator.js
*/
v2.Validator.reg('min-val', function(field, value, params) {
- return Number(value) >= Number(params[0]);
+ return +value >= +params[0];
}, 'min');
Please sign in to comment.
Something went wrong with that request. Please try again.