1 var baseHasIn = require('./_baseHasIn'),
2 hasPath = require('./_hasPath');
5 * Checks if `path` is a direct or inherited property of `object`.
11 * @param {Object} object The object to query.
12 * @param {Array|string} path The path to check.
13 * @returns {boolean} Returns `true` if `path` exists, else `false`.
16 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
18 * _.hasIn(object, 'a');
21 * _.hasIn(object, 'a.b');
24 * _.hasIn(object, ['a', 'b']);
27 * _.hasIn(object, 'b');
30 function hasIn(object, path) {
31 return object != null && hasPath(object, path, baseHasIn);
34 module.exports = hasIn;