Skip to content

Commit

Permalink
Minor improvements to the ‘maxItems’ attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
František Hába committed Mar 8, 2012
1 parent 7a1b3b9 commit 637ed6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/engines/json/attributes.js
Expand Up @@ -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);
}
};
},

Expand Down

0 comments on commit 637ed6e

Please sign in to comment.