Browse files

Minor improvements to the ‘maxLength’ attribute

  • Loading branch information...
1 parent 09a185d commit 7caf19a13159fcef1e05053b73ba52e42a6a678d @Baggz committed Mar 9, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/engines/json/attributes.js
View
6 src/engines/json/attributes.js
@@ -145,7 +145,11 @@ Validation.prototype.attributes = {
*/
maxLength: function maxLengthConstructor() {
return function maxLength(property, propertyValue, attributeValue, propertyAttributes, callback) {
- return (typeof propertyValue === 'string' && propertyValue.length <= attributeValue) ? callback() : callback(true);
+ if (isString(propertyValue) && propertyValue.length <= attributeValue) {
+ return callback();
+ } else {
+ return callback(true);
+ }
};
},

0 comments on commit 7caf19a

Please sign in to comment.