* 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.
(object, path)
| 468 | * @returns {*} Returns the resolved value. |
| 469 | */ |
| 470 | function baseGet(object, path) { |
| 471 | path = isKey(path, object) ? [path] : castPath(path); |
| 472 | |
| 473 | let index = 0, |
| 474 | length = path.length; |
| 475 | |
| 476 | while (object != null && index < length) { |
| 477 | object = object[toKey(path[index++])]; |
| 478 | } |
| 479 | return index && index == length ? object : undefined; |
| 480 | } |
| 481 | |
| 482 | /** |
| 483 | * The base implementation of `_.isNative` without bad shim checks. |