_baseHas.js 559 B

12345678910111213141516171819
  1. /** Used for built-in method references. */
  2. var objectProto = Object.prototype;
  3. /** Used to check objects for own properties. */
  4. var hasOwnProperty = objectProto.hasOwnProperty;
  5. /**
  6. * The base implementation of `_.has` without support for deep paths.
  7. *
  8. * @private
  9. * @param {Object} [object] The object to query.
  10. * @param {Array|string} key The key to check.
  11. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  12. */
  13. function baseHas(object, key) {
  14. return object != null && hasOwnProperty.call(object, key);
  15. }
  16. module.exports = baseHas;