From 9cf809077e0a342dbb96d7ecf1752eaf72acd758 Mon Sep 17 00:00:00 2001 From: Stanislav Lesnikov Date: Fri, 29 Jan 2016 22:16:03 +0100 Subject: [PATCH] hasValue should return true for space(s) values --- src/backbone-validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backbone-validation.js b/src/backbone-validation.js index e4aa8de2..58ba4611 100644 --- a/src/backbone-validation.js +++ b/src/backbone-validation.js @@ -565,7 +565,7 @@ Backbone.Validation = (function(_){ // Determines whether or not a value is empty var hasValue = function(value) { - return !(_.isNull(value) || _.isUndefined(value) || (_.isString(value) && trim(value) === '') || (_.isArray(value) && _.isEmpty(value))); + return !(_.isNull(value) || _.isUndefined(value) || (_.isString(value) && value === '') || (_.isArray(value) && _.isEmpty(value))); }; return {