1 var toObject = require('./toObject');
4 * The base implementation of `get` without support for string paths
8 * @param {Object} object The object to query.
9 * @param {Array} path The path of the property to get.
10 * @param {string} [pathKey] The key representation of path.
11 * @returns {*} Returns the resolved value.
13 function baseGet(object, path, pathKey) {
17 if (pathKey !== undefined && pathKey in toObject(object)) {
23 while (object != null && index < length) {
24 object = object[path[index++]];
26 return (index && index == length) ? object : undefined;
29 module.exports = baseGet;