mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Bump to v4.0.0.
This commit is contained in:
@@ -1,22 +1,17 @@
|
||||
import toObject from './toObject';
|
||||
import baseToPath from './baseToPath';
|
||||
import isKey from './isKey';
|
||||
|
||||
/**
|
||||
* The base implementation of `get` without support for string paths
|
||||
* and default values.
|
||||
* The base implementation of `_.get` without support for default values.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array} path The path of the property to get.
|
||||
* @param {string} [pathKey] The key representation of path.
|
||||
* @param {Array|string} path The path of the property to get.
|
||||
* @returns {*} Returns the resolved value.
|
||||
*/
|
||||
function baseGet(object, path, pathKey) {
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
if (pathKey !== undefined && pathKey in toObject(object)) {
|
||||
path = [pathKey];
|
||||
}
|
||||
function baseGet(object, path) {
|
||||
path = isKey(path, object) ? [path + ''] : baseToPath(path);
|
||||
|
||||
var index = 0,
|
||||
length = path.length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user