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