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.method v4.1.1
# lodash.method v4.2.0
The [lodash](https://lodash.com/) method `_.method` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var method = require('lodash.method');
```
See the [documentation](https://lodash.com/docs#method) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.method) for more details.
See the [documentation](https://lodash.com/docs#method) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.method) 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'),
rest = require('lodash.rest'),
toString = require('lodash.tostring');
@@ -40,6 +39,37 @@ function apply(func, thisArg, args) {
return func.apply(thisArg, args);
}
/**
* 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.
*
* @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;
}
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
@@ -52,7 +82,7 @@ function apply(func, thisArg, args) {
*/
function baseInvoke(object, path, args) {
if (!isKey(path, object)) {
path = baseToPath(path);
path = baseCastPath(path);
object = parent(object, path);
path = last(path);
}
@@ -60,18 +90,6 @@ function baseInvoke(object, path, args) {
return func == null ? undefined : apply(func, object, args);
}
/**
* The base implementation of `_.toPath` which only converts `value` to a
* path if it's not one.
*
* @private
* @param {*} value The value to process.
* @returns {Array} Returns the property path array.
*/
function baseToPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* Checks if `value` is a property name and not a property path.
*
@@ -139,7 +157,7 @@ function last(array) {
*
* @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`.
@@ -159,6 +177,35 @@ function last(array) {
*/
var isArray = Array.isArray;
/**
* 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;
}
/**
* Creates a function that invokes the method at `path` of a given object.
* Any additional arguments are provided to the invoked method.

View File

@@ -1,6 +1,6 @@
{
"name": "lodash.method",
"version": "4.1.1",
"version": "4.2.0",
"description": "The lodash method `_.method` 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.rest": "^4.0.0",
"lodash.tostring": "^4.0.0"
}