You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hasValue() returns an info whether data being validated has any value .. basically it checks whether data is empty. This works fine for everything except for object, for which hasValue returns true even if it's empty ..
hasValue() returns an info whether data being validated has any value .. basically it checks whether data is empty. This works fine for everything except for object, for which hasValue returns true even if it's empty ..
https://github.com/thedersen/backbone.validation/blob/master/src/backbone-validation.js#L568
I'm not sure if this is by design, but I would expect that empty object be treated as having no value.
Also, I believe underscores '_.isEmpty' would cover all of the cases since it's pretty consistent in what it considers 'empty'
so in stead of hasValue(value), !_.isEmpty(value) could be used ?
The text was updated successfully, but these errors were encountered: