1 var castPath = require('./_castPath'),
2 toKey = require('./_toKey');
5 * The base implementation of `_.get` without support for default values.
8 * @param {Object} object The object to query.
9 * @param {Array|string} path The path of the property to get.
10 * @returns {*} Returns the resolved value.
12 function baseGet(object, path) {
13 path = castPath(path, object);
18 while (object != null && index < length) {
19 object = object[toKey(path[index++])];
21 return (index && index == length) ? object : undefined;
24 module.exports = baseGet;