node_modules/handlebars-utils/index.js
/**
 * Returns true if the given value is "empty".
 *
 * ```js
 * console.log(utils.isEmpty(0));
 * //=> false
 * console.log(utils.isEmpty(''));
 * //=> true
 * console.log(utils.isEmpty([]));
 * //=> true
 * console.log(utils.isEmpty({}));
 * //=> true
 * ```
 * @name .isEmpty
 * @param {any} `value`
 * @return {Boolean}
 * @api public
 */
Returns true if the given value is "empty".
Returns true if the given value is " empty " .
function isEmpty(val) {
  if (val === 0 || typeof val === 'boolean') {
    return false;
  }
  if (val == null) {
    return true;
  }
  if (utils.isObject(val)) {
    val = Object.keys(val);
  }
  if (!val.length) {
    return true;
  }
  return false;
}
function isEmpty ( val ) { if ( val === 0 || typeof val === 'boolean' ) { return false ; } if ( val == null ) { return true ; } if ( utils . isObject ( val ) ) { val = Object . keys ( val ) ; } if ( ! val . length ) { return true ; } return false ; }
Returns true if the given value is "empty".
Returns true if the given value is " empty " .