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

85
dist/lodash.compat.js vendored
View File

@@ -3670,7 +3670,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);
@@ -3886,14 +3886,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 = [
@@ -3936,7 +3936,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) {
@@ -3949,6 +3949,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;
@@ -4383,7 +4411,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.
@@ -4398,7 +4425,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
@@ -4789,25 +4818,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));
}
/*--------------------------------------------------------------------------*/
@@ -5759,7 +5792,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 = {
@@ -5805,7 +5838,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 = {
@@ -6186,14 +6219,10 @@
if (!value) {
return result;
}
var className = toString.call(value),
length = value.length;
if (length > -1 && length <= maxSafeInteger && (
(className == arrayClass || className == stringClass ||
(support.argsClass ? className == argsClass : isArguments(value))) ||
(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() {
@@ -7747,7 +7776,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);
}
/**
@@ -8345,6 +8374,7 @@
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.findWhere = findWhere;
lodash.has = has;
lodash.identity = identity;
lodash.indexOf = indexOf;
@@ -8398,7 +8428,6 @@
lodash.all = every;
lodash.any = some;
lodash.detect = find;
lodash.findWhere = find;
lodash.foldl = reduce;
lodash.foldr = reduceRight;
lodash.include = contains;