MCPcopy
hub / github.com/lodash/lodash / baseGet

Function baseGet

lodash.js:3075–3085  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

3073 * @returns {*} Returns the resolved value.
3074 */
3075 function baseGet(object, path) {
3076 path = castPath(path, object);
3077
3078 var index = 0,
3079 length = path.length;
3080
3081 while (object != null && index < length) {
3082 object = object[toKey(path[index++])];
3083 }
3084 return (index && index == length) ? object : undefined;
3085 }
3086
3087 /**
3088 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses

Callers 7

baseOrderByFunction · 0.85
basePickByFunction · 0.85
basePropertyDeepFunction · 0.85
baseUpdateFunction · 0.85
parentFunction · 0.85
getFunction · 0.85
propertyOfFunction · 0.85

Calls 2

castPathFunction · 0.85
toKeyFunction · 0.85

Tested by

no test coverage detected