Permalink
Browse files

Minor improvements to the ‘maxItems’ attribute

  • Loading branch information...
1 parent 7a1b3b9 commit 637ed6e900bde9e619414a545e5b6ca9e0c394c9 @Baggz committed Mar 8, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/engines/json/attributes.js
@@ -223,7 +223,11 @@ Validation.prototype.attributes = {
*/
maxItems: function maxItemsConstructor() {
return function maxItems(property, propertyValue, attributeValue, propertyAttributes, callback) {
- return (isArray(propertyValue) && propertyValue.length <= attributeValue) ? callback() : callback(true);
+ if (isArray(propertyValue) && propertyValue.length <= attributeValue) {
+ return callback();
+ } else {
+ return callback(true);
+ }
};
},

0 comments on commit 637ed6e

Please sign in to comment.