mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Rebuild /dist files.
This commit is contained in:
107
dist/lodash.compat.js
vendored
107
dist/lodash.compat.js
vendored
@@ -1372,6 +1372,34 @@
|
||||
return collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.forEachEach` without support for callback
|
||||
* shorthands or `thisArg` binding.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function} callback The function called per iteration.
|
||||
* @returns {Array|Object|string} Returns `collection`.
|
||||
*/
|
||||
function baseEachRight(collection, callback) {
|
||||
var iterable = collection,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
if (typeof length == 'number') {
|
||||
if (support.unindexedChars && isString(iterable)) {
|
||||
iterable = iterable.split('');
|
||||
}
|
||||
while (length--) {
|
||||
if (callback(iterable[length], length, collection) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
baseForOwnRight(collection, callback);
|
||||
}
|
||||
return collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.flatten` without support for callback
|
||||
* shorthands or `thisArg` binding.
|
||||
@@ -1435,6 +1463,28 @@
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.forOwnRight` without support for callback
|
||||
* shorthands or `thisArg` binding.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} callback The function called per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseForOwnRight(object, callback) {
|
||||
var props = keys(object),
|
||||
length = props.length;
|
||||
|
||||
while (length--) {
|
||||
var key = props[length];
|
||||
if (callback(object[key], key, object) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isEqual`, without support for `thisArg` binding,
|
||||
* that allows partial "_.where" style comparisons.
|
||||
@@ -1745,8 +1795,8 @@
|
||||
function createAggregator(setter) {
|
||||
return function(collection, callback, thisArg) {
|
||||
var result = {};
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
@@ -2193,6 +2243,7 @@
|
||||
*/
|
||||
function findLastIndex(array, callback, thisArg) {
|
||||
var length = array ? array.length : 0;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
while (length--) {
|
||||
if (callback(array[length], length, array)) {
|
||||
@@ -3442,8 +3493,8 @@
|
||||
*/
|
||||
function every(collection, callback, thisArg) {
|
||||
var result = true;
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
@@ -3503,8 +3554,8 @@
|
||||
*/
|
||||
function filter(collection, callback, thisArg) {
|
||||
var result = [];
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
@@ -3570,7 +3621,6 @@
|
||||
*/
|
||||
function find(collection, callback, thisArg) {
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
@@ -3615,8 +3665,9 @@
|
||||
*/
|
||||
function findLast(collection, callback, thisArg) {
|
||||
var result;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forEachRight(collection, function(value, index, collection) {
|
||||
baseEachRight(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result = value;
|
||||
return false;
|
||||
@@ -3685,27 +3736,15 @@
|
||||
* // => logs each number from right to left and returns '3,2,1'
|
||||
*/
|
||||
function forEachRight(collection, callback, thisArg) {
|
||||
var iterable = collection,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);
|
||||
if (isArray(collection)) {
|
||||
if (callback && typeof thisArg == 'undefined' && isArray(collection)) {
|
||||
var length = collection.length;
|
||||
while (length--) {
|
||||
if (callback(collection[length], length, collection) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (typeof length != 'number') {
|
||||
var props = keys(collection);
|
||||
length = props.length;
|
||||
} else if (support.unindexedChars && isString(collection)) {
|
||||
iterable = collection.split('');
|
||||
}
|
||||
baseEach(iterable, function(value, key) {
|
||||
key = props ? props[--length] : --length;
|
||||
return callback(iterable[key], key, collection);
|
||||
});
|
||||
baseEachRight(collection, baseCreateCallback(callback, thisArg, 3));
|
||||
}
|
||||
return collection;
|
||||
}
|
||||
@@ -4094,8 +4133,8 @@
|
||||
*/
|
||||
function reduce(collection, callback, accumulator, thisArg) {
|
||||
var noaccum = arguments.length < 3;
|
||||
callback = lodash.createCallback(callback, thisArg, 4);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 4);
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
@@ -4137,8 +4176,9 @@
|
||||
*/
|
||||
function reduceRight(collection, callback, accumulator, thisArg) {
|
||||
var noaccum = arguments.length < 3;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 4);
|
||||
forEachRight(collection, function(value, index, collection) {
|
||||
baseEachRight(collection, function(value, index, collection) {
|
||||
accumulator = noaccum
|
||||
? (noaccum = false, value)
|
||||
: callback(accumulator, value, index, collection);
|
||||
@@ -4321,8 +4361,8 @@
|
||||
*/
|
||||
function some(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
@@ -4399,12 +4439,20 @@
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
}
|
||||
baseEach(collection, function(value, key, collection) {
|
||||
if (multi) {
|
||||
var length = callback.length,
|
||||
criteria = Array(length);
|
||||
|
||||
while (length--) {
|
||||
criteria[length] = value[callback[length]];
|
||||
}
|
||||
} else {
|
||||
criteria = callback(value, key, collection);
|
||||
}
|
||||
var object = result[++index] = getObject();
|
||||
object.criteria = criteria;
|
||||
object.index = index;
|
||||
object.value = value;
|
||||
object.criteria = multi
|
||||
? map(callback, function(key) { return value[key]; })
|
||||
: callback(value, key, collection);
|
||||
});
|
||||
|
||||
length = result.length;
|
||||
@@ -5427,6 +5475,7 @@
|
||||
*/
|
||||
function findKey(object, callback, thisArg) {
|
||||
var result;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
baseForOwn(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
@@ -5480,8 +5529,9 @@
|
||||
*/
|
||||
function findLastKey(object, callback, thisArg) {
|
||||
var result;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forOwnRight(object, function(value, key, object) {
|
||||
baseForOwnRight(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
result = key;
|
||||
return false;
|
||||
@@ -5556,7 +5606,6 @@
|
||||
*/
|
||||
function forInRight(object, callback, thisArg) {
|
||||
var pairs = [];
|
||||
|
||||
baseForIn(object, function(value, key) {
|
||||
pairs.push(key, value);
|
||||
});
|
||||
@@ -6196,8 +6245,8 @@
|
||||
*/
|
||||
function mapValues(object, callback, thisArg) {
|
||||
var result = {};
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
baseForOwn(object, function(value, key, object) {
|
||||
result[key] = callback(value, key, object);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user