Bump to v3.6.0.

This commit is contained in:
John-David Dalton
2015-12-16 17:49:07 -08:00
parent 707fe171fc
commit 9724afd7a6
193 changed files with 2191 additions and 1764 deletions

View File

@@ -1,4 +1,4 @@
define(['../lang/isError'], function(isError) {
define(['../lang/isError', '../function/restParam'], function(isError, restParam) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -10,7 +10,7 @@ define(['../lang/isError'], function(isError) {
* @static
* @memberOf _
* @category Utility
* @param {*} func The function to attempt.
* @param {Function} func The function to attempt.
* @returns {*} Returns the `func` result or error object.
* @example
*
@@ -23,20 +23,13 @@ define(['../lang/isError'], function(isError) {
* elements = [];
* }
*/
function attempt() {
var func = arguments[0],
length = arguments.length,
args = Array(length ? (length - 1) : 0);
while (--length > 0) {
args[length - 1] = arguments[length];
}
var attempt = restParam(function(func, args) {
try {
return func.apply(undefined, args);
} catch(e) {
return isError(e) ? e : new Error(e);
}
}
});
return attempt;
});

View File

@@ -18,12 +18,11 @@ define(['../internal/baseClone', '../internal/baseMatchesProperty'], function(ba
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' },
* { 'user': 'pebbles' }
* { 'user': 'fred' }
* ];
*
* _.find(users, _.matchesProperty('user', 'fred'));
* // => { 'user': 'fred', 'age': 40 }
* // => { 'user': 'fred' }
*/
function matchesProperty(key, value) {
return baseMatchesProperty(key + '', baseClone(value, true));

View File

@@ -11,6 +11,9 @@ define(['../internal/arrayCopy', '../internal/baseFunctions', '../lang/isFunctio
* destination object. If `object` is a function then methods are added to
* its prototype as well.
*
* **Note:** Use `_.runInContext` to create a pristine `lodash` function
* for mixins to avoid conflicts caused by modifying the original.
*
* @static
* @memberOf _
* @category Utility
@@ -28,7 +31,7 @@ define(['../internal/arrayCopy', '../internal/baseFunctions', '../lang/isFunctio
* });
* }
*
* // use `_.runInContext` to avoid potential conflicts (esp. in Node.js)
* // use `_.runInContext` to avoid conflicts (esp. in Node.js)
* var _ = require('lodash').runInContext();
*
* _.mixin({ 'vowels': vowels });
@@ -65,12 +68,10 @@ define(['../internal/arrayCopy', '../internal/baseFunctions', '../lang/isFunctio
return function() {
var chainAll = this.__chain__;
if (chain || chainAll) {
var result = object(this.__wrapped__);
(result.__actions__ = arrayCopy(this.__actions__)).push({
'func': func,
'args': arguments,
'thisArg': object
});
var result = object(this.__wrapped__),
actions = result.__actions__ = arrayCopy(this.__actions__);
actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
result.__chain__ = chainAll;
return result;
}

View File

@@ -18,7 +18,7 @@ define(['../internal/baseProperty'], function(baseProperty) {
* var getName = _.property('user');
*
* _.map(users, getName);
* // => ['fred', barney']
* // => ['fred', 'barney']
*
* _.pluck(_.sortBy(users, getName), 'user');
* // => ['barney', 'fred']

View File

@@ -4,7 +4,7 @@ define([], function() {
var undefined;
/**
* The inverse of `_.property`; this method creates a function which returns
* The opposite of `_.property`; this method creates a function which returns
* the property value of a given key on `object`.
*
* @static