Urara-Blog/node_modules/.pnpm-store/v3/files/b6/4539498633515c4f4243cd05a501ee036b3f9a94d55d8c8f362c1d675e5b53136b5c011395355944e117e76a4084116b9fe9e34972c23f0614569f4552c790
2022-08-14 01:14:53 +08:00

24 lines
616 B
Text

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