Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bdavidxyz committed Dec 21, 2016
1 parent f300af4 commit 5ca5acf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions live/app/utils/lodash-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ _.mixin({
return _.includes(collection, element);
},
isTruthy: function(x) {
return x !== false
&& x !== 0
&& x !== undefined
&& x !== null
&& x !== ''
&& !(_.isArray(x) && _.isEmpty(x)) // not an empty array
return x !== false // not the boolean false
&& x !== 0 // not the number 0
&& x !== undefined // not an undefined value
&& x !== null // not a null value
&& x !== '' // not an empty string
&& !(_.isArray(x) && _.isEmpty(x)) // not an empty array
&& !(_.isObject(x) && _.isEmpty(x)); // not an empty object
},
// Not enough value to test a function which is just the opposite of a boolean function
Expand Down

0 comments on commit 5ca5acf

Please sign in to comment.