lodash.get
Advanced tools
Comparing version 4.2.0 to 4.2.1
31
index.js
/** | ||
* lodash 4.2.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.2.1 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -22,3 +22,4 @@ * Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
/** | ||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* of values. | ||
@@ -29,13 +30,2 @@ */ | ||
/** | ||
* Casts `value` to a path array if it's not one. | ||
* | ||
* @private | ||
* @param {*} value The value to inspect. | ||
* @returns {Array} Returns the cast property path array. | ||
*/ | ||
function baseCastPath(value) { | ||
return isArray(value) ? value : stringToPath(value); | ||
} | ||
/** | ||
* The base implementation of `_.get` without support for default values. | ||
@@ -49,3 +39,3 @@ * | ||
function baseGet(object, path) { | ||
path = isKey(path, object) ? [path] : baseCastPath(path); | ||
path = isKey(path, object) ? [path] : castPath(path); | ||
@@ -62,2 +52,13 @@ var index = 0, | ||
/** | ||
* Casts `value` to a path array if it's not one. | ||
* | ||
* @private | ||
* @param {*} value The value to inspect. | ||
* @returns {Array} Returns the cast property path array. | ||
*/ | ||
function castPath(value) { | ||
return isArray(value) ? value : stringToPath(value); | ||
} | ||
/** | ||
* Checks if `value` is a property name and not a property path. | ||
@@ -160,3 +161,3 @@ * | ||
* Gets the value at `path` of `object`. If the resolved value is | ||
* `undefined` the `defaultValue` is used in its place. | ||
* `undefined`, the `defaultValue` is used in its place. | ||
* | ||
@@ -163,0 +164,0 @@ * @static |
{ | ||
"name": "lodash.get", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "The lodash method `_.get` exported as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash.get v4.2.0 | ||
# lodash.get v4.2.1 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.get` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#get) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.get) for more details. | ||
See the [documentation](https://lodash.com/docs#get) or [package source](https://github.com/lodash/lodash/blob/4.2.1-npm-packages/lodash.get) for more details. |
171
7906