From 637ed6e900bde9e619414a545e5b6ca9e0c394c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frantis=CC=8Cek=20Ha=CC=81ba?= Date: Fri, 9 Mar 2012 00:10:45 +0100 Subject: [PATCH] =?UTF-8?q?Minor=20improvements=20to=20the=20=E2=80=98maxI?= =?UTF-8?q?tems=E2=80=99=20attribute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/engines/json/attributes.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engines/json/attributes.js b/src/engines/json/attributes.js index 52c2d4f..f14cc4d 100644 --- a/src/engines/json/attributes.js +++ b/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); + } }; },