Rebuild dist.

This commit is contained in:
John-David Dalton
2014-04-15 23:21:37 -07:00
parent 841890c178
commit 7017766591
6 changed files with 315 additions and 220 deletions

84
dist/lodash.js vendored
View File

@@ -3485,7 +3485,7 @@
* @param {Array|Object|string} collection The collection to search.
* @param {*} target The value to check for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {boolean} Returns `true` if the target element is found, else `false`.
* @returns {boolean} Returns `true` if a matching element is found, else `false`.
* @example
*
* _.contains([1, 2, 3], 1);
@@ -3701,14 +3701,14 @@
*
* @static
* @memberOf _
* @alias detect, findWhere
* @alias detect
* @category Collections
* @param {Array|Object|string} collection The collection to search.
* @param {Function|Object|string} [predicate=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {*} Returns the found element, else `undefined`.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var characters = [
@@ -3753,7 +3753,7 @@
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {*} Returns the found element, else `undefined`.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(num) {
@@ -3766,6 +3766,34 @@
return baseFind(collection, predicate, baseEachRight);
}
/**
* Performs a deep comparison between each element in `collection` and the
* source object, returning the first element that has equivalent property
* values.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to search.
* @param {Object} source The object of property values to match.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'employer': 'slate' },
* { 'name': 'fred', 'age': 40, 'employer': 'slate' }
* ];
*
* _.findWhere(characters, { 'employer': 'slate' });
* // => { 'name': 'barney', 'age': 36, 'employer': 'slate' }
*
* _.findWhere(characters, { 'age': 40 });
* // => { 'name': 'fred', 'age': 40, 'employer': 'slate' }
*/
function findWhere(collection, source) {
return find(collection, matches(source));
}
/**
* Iterates over elements of a collection executing the callback for each
* element. The callback is bound to `thisArg` and invoked with three arguments;
@@ -4207,7 +4235,6 @@
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {string} key The name of the property to pluck.
@@ -4222,7 +4249,9 @@
* _.pluck(characters, 'name');
* // => ['barney', 'fred']
*/
var pluck = map;
function pluck(collection, key) {
return map(collection, property(key));
}
/**
* Reduces a collection to a value which is the accumulated result of running
@@ -4609,25 +4638,29 @@
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Object} source The object of property values to filter by.
* @param {Array|Object|string} collection The collection to search.
* @param {Object} source The object of property values to match.
* @returns {Array} Returns the new filtered array.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] },
* { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
* { 'name': 'barney', 'age': 36, 'employer': 'slate', 'pets': ['hoppy'] },
* { 'name': 'fred', 'age': 40, 'employer': 'slate', 'pets': ['baby puss', 'dino'] }
* ];
*
* _.where(characters, { 'age': 36 });
* // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }]
* _.pluck(_.where(characters, { 'age': 36 }), 'name');
* // => ['barney']
*
* _.where(characters, { 'pets': ['dino'] });
* // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }]
* _.pluck(_.where(characters, { 'pets': ['dino'] }), 'name');
* // => ['fred']
*
* _.pluck(_.where(characters, { 'employer': 'slate' }), 'name');
* // => ['barney', 'fred']
*/
var where = filter;
function where(collection, source) {
return filter(collection, matches(source));
}
/*--------------------------------------------------------------------------*/
@@ -5579,7 +5612,7 @@
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
* @returns {string|undefined} Returns the key of the matched element, else `undefined`.
* @example
*
* var characters = {
@@ -5625,7 +5658,7 @@
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
* @returns {string|undefined} Returns the key of the matched element, else `undefined`.
* @example
*
* var characters = {
@@ -5999,13 +6032,10 @@
if (!value) {
return result;
}
var className = toString.call(value),
length = value.length;
if (length > -1 && length <= maxSafeInteger && (
(className == arrayClass || className == stringClass || className == argsClass) ||
(className == objectClass && isFunction(value.splice))
)) {
var length = value.length;
if (length > -1 && length <= maxSafeInteger &&
(isArray(value) || isString(value) || isArguments(value) ||
(typeof value == 'object' && isFunction(value.splice)))) {
return !length;
}
baseForOwn(value, function() {
@@ -7526,7 +7556,7 @@
func || baseCreateCallback(func, thisArg, argCount);
}
// handle "_.pluck" and "_.where" style callback shorthands
return type != 'object' ? property(func) : matches(func);
return type == 'object' ? matches(func) : property(func);
}
/**
@@ -8124,6 +8154,7 @@
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.findWhere = findWhere;
lodash.has = has;
lodash.identity = identity;
lodash.indexOf = indexOf;
@@ -8177,7 +8208,6 @@
lodash.all = every;
lodash.any = some;
lodash.detect = find;
lodash.findWhere = find;
lodash.foldl = reduce;
lodash.foldr = reduceRight;
lodash.include = contains;