Bump to v4.2.0.

This commit is contained in:
John-David Dalton
2016-04-07 23:43:26 -07:00
parent 3c2a06a119
commit fdf249c94e
562 changed files with 23863 additions and 21738 deletions

View File

@@ -1,4 +1,4 @@
# lodash.result v4.1.1
# lodash.result v4.2.0
The [lodash](https://lodash.com/) method `_.result` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var result = require('lodash.result');
```
See the [documentation](https://lodash.com/docs#result) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.result) for more details.
See the [documentation](https://lodash.com/docs#result) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.result) for more details.

View File

@@ -1,5 +1,5 @@
/**
* lodash 4.1.1 (Custom Build) <https://lodash.com/>
* lodash 4.2.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -7,7 +7,6 @@
* Available under MIT license <https://lodash.com/license>
*/
var baseSlice = require('lodash._baseslice'),
get = require('lodash.get'),
toString = require('lodash.tostring');
/** `Object#toString` result references. */
@@ -32,17 +31,36 @@ var objectProto = Object.prototype;
var objectToString = objectProto.toString;
/**
* The base implementation of `_.toPath` which only converts `value` to a
* path if it's not one.
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to process.
* @returns {Array} Returns the property path array.
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function baseToPath(value) {
function baseCastPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* 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 = isKey(path, object) ? [path + ''] : baseCastPath(path);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[path[index++]];
}
return (index && index == length) ? object : undefined;
}
/**
* Checks if `value` is a property name and not a property path.
*
@@ -92,7 +110,7 @@ function stringToPath(string) {
*
* @static
* @memberOf _
* @type Function
* @type {Function}
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
@@ -130,8 +148,8 @@ var isArray = Array.isArray;
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array constructors, and
// PhantomJS 1.9 which returns 'function' for `NodeList` instances.
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
@@ -164,6 +182,35 @@ function isObject(value) {
return !!value && (type == 'object' || type == 'function');
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined` the `defaultValue` is used in its place.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
/**
* This method is like `_.get` except that if the resolved value is a function
* it's invoked with the `this` binding of its parent object and its result
@@ -194,7 +241,7 @@ function isObject(value) {
*/
function result(object, path, defaultValue) {
if (!isKey(path, object)) {
path = baseToPath(path);
path = baseCastPath(path);
var result = get(object, path);
object = parent(object, path);
} else {

View File

@@ -1,6 +1,6 @@
{
"name": "lodash.result",
"version": "4.1.1",
"version": "4.2.0",
"description": "The lodash method `_.result` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
@@ -16,7 +16,6 @@
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" },
"dependencies": {
"lodash._baseslice": "^4.0.0",
"lodash.get": "^4.0.0",
"lodash.tostring": "^4.0.0"
}
}