function hasValue(object, path, predicate) {
  var value = _.get(object, path);
  var result = false;

  if(arguments.length < 3) {
    result = !_.isNil(value);
  } else if(_.isFunction(predicate)) {
    result = predicate(value);
  } else {
    result = _.eq(predicate, value);
  }

  return result;
}
Checks if path is a direct property of object and has an value other than undefined.

@static
@memberOf _
@param {Object} object - The object to query.
@param {Array|string} path - The path to check.
@param {*|Function} [predicate] - The value or function at the path to compare with.
@returns {boolean} Returns true if path exists and has an value, else false.