Compare commits

..

12 Commits

Author SHA1 Message Date
John-David Dalton
8349627be6 Bump to v4.8.2. 2016-04-04 13:35:30 -07:00
John-David Dalton
a2438ffc51 Bump to v4.8.0. 2016-04-03 22:48:11 -07:00
John-David Dalton
d46bcaa98d Bump to v4.7.0. 2016-03-31 00:33:47 -07:00
John-David Dalton
6c2960211f Bump to v4.6.1. 2016-03-01 22:11:23 -08:00
John-David Dalton
8166b65853 Bump to v4.6.0. 2016-02-29 23:38:21 -08:00
John-David Dalton
65e5d998b3 Bump to v4.5.1. 2016-02-21 20:40:07 -08:00
John-David Dalton
ae51b52aa1 Bump to v4.5.0. 2016-02-16 23:13:56 -08:00
John-David Dalton
ce259221bd Bump to v4.4.0. 2016-02-15 20:20:54 -08:00
John-David Dalton
3514f50902 Bump to v4.3.0. 2016-02-08 00:49:56 -08:00
John-David Dalton
e2a6db008f Bump to v4.2.1. 2016-02-03 00:57:54 -08:00
John-David Dalton
5ca813254d Bump to v4.2.0. 2016-02-02 00:02:37 -08:00
John-David Dalton
7293d39642 Bump to v4.1.0. 2016-01-29 01:14:13 -08:00
560 changed files with 6650 additions and 3337 deletions

29
LICENSE
View File

@@ -1,7 +1,17 @@
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including "Software"), to deal in the Software without restriction, including
@@ -20,3 +30,18 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@@ -1,6 +1,6 @@
# lodash-amd v4.0.1 # lodash-amd v4.8.2
The [lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules. The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli): Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
```bash ```bash
@@ -27,4 +27,4 @@ require({
}); });
``` ```
See the [package source](https://github.com/lodash/lodash/tree/4.0.1-amd) for more details. See the [package source](https://github.com/lodash/lodash/tree/4.8.2-amd) for more details.

7
_DataView.js Normal file
View File

@@ -0,0 +1,7 @@
define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
return DataView;
});

View File

@@ -1,4 +1,4 @@
define(['./nativeCreate'], function(nativeCreate) { define(['./_nativeCreate'], function(nativeCreate) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto = Object.prototype; var objectProto = Object.prototype;
@@ -7,6 +7,7 @@ define(['./nativeCreate'], function(nativeCreate) {
* Creates an hash object. * Creates an hash object.
* *
* @private * @private
* @constructor
* @returns {Object} Returns the new hash object. * @returns {Object} Returns the new hash object.
*/ */
function Hash() {} function Hash() {}

View File

@@ -1,4 +1,4 @@
define(['./baseCreate', './baseLodash'], function(baseCreate, baseLodash) { define(['./_baseCreate', './_baseLodash'], function(baseCreate, baseLodash) {
/** Used as references for the maximum length and index of an array. */ /** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295; var MAX_ARRAY_LENGTH = 4294967295;
@@ -7,6 +7,7 @@ define(['./baseCreate', './baseLodash'], function(baseCreate, baseLodash) {
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
* *
* @private * @private
* @constructor
* @param {*} value The value to wrap. * @param {*} value The value to wrap.
*/ */
function LazyWrapper(value) { function LazyWrapper(value) {
@@ -19,6 +20,7 @@ define(['./baseCreate', './baseLodash'], function(baseCreate, baseLodash) {
this.__views__ = []; this.__views__ = [];
} }
// Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper; LazyWrapper.prototype.constructor = LazyWrapper;

View File

@@ -1,4 +1,4 @@
define(['./baseCreate', './baseLodash'], function(baseCreate, baseLodash) { define(['./_baseCreate', './_baseLodash'], function(baseCreate, baseLodash) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -8,7 +8,7 @@ define(['./baseCreate', './baseLodash'], function(baseCreate, baseLodash) {
* *
* @private * @private
* @param {*} value The value to wrap. * @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable chaining for all wrapper methods. * @param {boolean} [chainAll] Enable explicit method chain sequences.
*/ */
function LodashWrapper(value, chainAll) { function LodashWrapper(value, chainAll) {
this.__wrapped__ = value; this.__wrapped__ = value;

View File

@@ -1,4 +1,4 @@
define(['./getNative', './root'], function(getNative, root) { define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'); var Map = getNative(root, 'Map');

View File

@@ -1,9 +1,10 @@
define(['./mapClear', './mapDelete', './mapGet', './mapHas', './mapSet'], function(mapClear, mapDelete, mapGet, mapHas, mapSet) { define(['./_mapClear', './_mapDelete', './_mapGet', './_mapHas', './_mapSet'], function(mapClear, mapDelete, mapGet, mapHas, mapSet) {
/** /**
* Creates a map cache object to store key-value pairs. * Creates a map cache object to store key-value pairs.
* *
* @private * @private
* @constructor
* @param {Array} [values] The values to cache. * @param {Array} [values] The values to cache.
*/ */
function MapCache(values) { function MapCache(values) {
@@ -17,7 +18,7 @@ define(['./mapClear', './mapDelete', './mapGet', './mapHas', './mapSet'], functi
} }
} }
// Add functions to the `MapCache`. // Add methods to `MapCache`.
MapCache.prototype.clear = mapClear; MapCache.prototype.clear = mapClear;
MapCache.prototype['delete'] = mapDelete; MapCache.prototype['delete'] = mapDelete;
MapCache.prototype.get = mapGet; MapCache.prototype.get = mapGet;

7
_Promise.js Normal file
View File

@@ -0,0 +1,7 @@
define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
return Promise;
});

View File

@@ -1,4 +1,4 @@
define(['./root'], function(root) { define(['./_root'], function(root) {
/** Built-in value references. */ /** Built-in value references. */
var Reflect = root.Reflect; var Reflect = root.Reflect;

View File

@@ -1,4 +1,4 @@
define(['./getNative', './root'], function(getNative, root) { define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set'); var Set = getNative(root, 'Set');

View File

@@ -1,10 +1,11 @@
define(['./MapCache', './cachePush'], function(MapCache, cachePush) { define(['./_MapCache', './_cachePush'], function(MapCache, cachePush) {
/** /**
* *
* Creates a set cache object to store unique values. * Creates a set cache object to store unique values.
* *
* @private * @private
* @constructor
* @param {Array} [values] The values to cache. * @param {Array} [values] The values to cache.
*/ */
function SetCache(values) { function SetCache(values) {
@@ -17,7 +18,7 @@ define(['./MapCache', './cachePush'], function(MapCache, cachePush) {
} }
} }
// Add functions to the `SetCache`. // Add methods to `SetCache`.
SetCache.prototype.push = cachePush; SetCache.prototype.push = cachePush;
return SetCache; return SetCache;

View File

@@ -1,9 +1,10 @@
define(['./stackClear', './stackDelete', './stackGet', './stackHas', './stackSet'], function(stackClear, stackDelete, stackGet, stackHas, stackSet) { define(['./_stackClear', './_stackDelete', './_stackGet', './_stackHas', './_stackSet'], function(stackClear, stackDelete, stackGet, stackHas, stackSet) {
/** /**
* Creates a stack cache object to store key-value pairs. * Creates a stack cache object to store key-value pairs.
* *
* @private * @private
* @constructor
* @param {Array} [values] The values to cache. * @param {Array} [values] The values to cache.
*/ */
function Stack(values) { function Stack(values) {
@@ -17,7 +18,7 @@ define(['./stackClear', './stackDelete', './stackGet', './stackHas', './stackSet
} }
} }
// Add functions to the `Stack` cache. // Add methods to `Stack`.
Stack.prototype.clear = stackClear; Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete; Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet; Stack.prototype.get = stackGet;

View File

@@ -1,4 +1,4 @@
define(['./root'], function(root) { define(['./_root'], function(root) {
/** Built-in value references. */ /** Built-in value references. */
var Symbol = root.Symbol; var Symbol = root.Symbol;

View File

@@ -1,4 +1,4 @@
define(['./root'], function(root) { define(['./_root'], function(root) {
/** Built-in value references. */ /** Built-in value references. */
var Uint8Array = root.Uint8Array; var Uint8Array = root.Uint8Array;

View File

@@ -1,4 +1,4 @@
define(['./getNative', './root'], function(getNative, root) { define(['./_getNative', './_root'], function(getNative, root) {
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap'); var WeakMap = getNative(root, 'WeakMap');

View File

@@ -9,6 +9,7 @@ define([], function() {
* @returns {Object} Returns `map`. * @returns {Object} Returns `map`.
*/ */
function addMapEntry(map, pair) { function addMapEntry(map, pair) {
// Don't return `Map#set` because it doesn't return the map instance in IE 11.
map.set(pair[0], pair[1]); map.set(pair[0], pair[1]);
return map; return map;
} }

View File

@@ -7,11 +7,11 @@ define([], function() {
* @private * @private
* @param {Function} func The function to invoke. * @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`. * @param {*} thisArg The `this` binding of `func`.
* @param {...*} [args] The arguments to invoke `func` with. * @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`. * @returns {*} Returns the result of `func`.
*/ */
function apply(func, thisArg, args) { function apply(func, thisArg, args) {
var length = args ? args.length : 0; var length = args.length;
switch (length) { switch (length) {
case 0: return func.call(thisArg); case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]); case 1: return func.call(thisArg, args[0]);

25
_arrayAggregator.js Normal file
View File

@@ -0,0 +1,25 @@
define([], function() {
/**
* A specialized version of `baseAggregator` for arrays.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function arrayAggregator(array, setter, iteratee, accumulator) {
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index];
setter(accumulator, value, iteratee(value), array);
}
return accumulator;
}
return arrayAggregator;
});

View File

@@ -7,7 +7,8 @@ define([], function() {
* @private * @private
* @param {Array} array The array to iterate over. * @param {Array} array The array to iterate over.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. * @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/ */
function arrayEvery(array, predicate) { function arrayEvery(array, predicate) {
var index = -1, var index = -1,

View File

@@ -12,13 +12,13 @@ define([], function() {
function arrayFilter(array, predicate) { function arrayFilter(array, predicate) {
var index = -1, var index = -1,
length = array.length, length = array.length,
resIndex = -1, resIndex = 0,
result = []; result = [];
while (++index < length) { while (++index < length) {
var value = array[index]; var value = array[index];
if (predicate(value, index, array)) { if (predicate(value, index, array)) {
result[++resIndex] = value; result[resIndex++] = value;
} }
} }
return result; return result;

View File

@@ -1,4 +1,4 @@
define(['./baseIndexOf'], function(baseIndexOf) { define(['./_baseIndexOf'], function(baseIndexOf) {
/** /**
* A specialized version of `_.includes` for arrays without support for * A specialized version of `_.includes` for arrays without support for

View File

@@ -1,8 +1,7 @@
define([], function() { define([], function() {
/** /**
* A specialized version of `_.includesWith` for arrays without support for * This function is like `arrayIncludes` except that it accepts a comparator.
* specifying an index to search from.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to search.

View File

@@ -8,7 +8,8 @@ define([], function() {
* @param {Array} array The array to iterate over. * @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration. * @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value. * @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value. * @returns {*} Returns the accumulated value.
*/ */
function arrayReduce(array, iteratee, accumulator, initAccum) { function arrayReduce(array, iteratee, accumulator, initAccum) {

View File

@@ -8,7 +8,8 @@ define([], function() {
* @param {Array} array The array to iterate over. * @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration. * @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value. * @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the last element of `array` as the initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value. * @returns {*} Returns the accumulated value.
*/ */
function arrayReduceRight(array, iteratee, accumulator, initAccum) { function arrayReduceRight(array, iteratee, accumulator, initAccum) {

View File

@@ -7,7 +7,8 @@ define([], function() {
* @private * @private
* @param {Array} array The array to iterate over. * @param {Array} array The array to iterate over.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. * @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/ */
function arraySome(array, predicate) { function arraySome(array, predicate) {
var index = -1, var index = -1,

View File

@@ -1,4 +1,4 @@
define(['../eq'], function(eq) { define(['./eq'], function(eq) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;

View File

@@ -1,10 +1,11 @@
define(['../eq'], function(eq) { define(['./eq'], function(eq) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
/** /**
* This function is like `assignValue` except that it doesn't assign `undefined` values. * This function is like `assignValue` except that it doesn't assign
* `undefined` values.
* *
* @private * @private
* @param {Object} object The object to modify. * @param {Object} object The object to modify.

View File

@@ -1,4 +1,4 @@
define(['../eq'], function(eq) { define(['./eq'], function(eq) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -21,8 +21,7 @@ define(['../eq'], function(eq) {
*/ */
function assignValue(object, key, value) { function assignValue(object, key, value) {
var objValue = object[key]; var objValue = object[key];
if ((!eq(objValue, value) || if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
(value === undefined && !(key in object))) { (value === undefined && !(key in object))) {
object[key] = value; object[key] = value;
} }

View File

@@ -1,4 +1,4 @@
define(['./assocIndexOf'], function(assocIndexOf) { define(['./_assocIndexOf'], function(assocIndexOf) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype; var arrayProto = Array.prototype;
@@ -10,7 +10,7 @@ define(['./assocIndexOf'], function(assocIndexOf) {
* Removes `key` and its value from the associative array. * Removes `key` and its value from the associative array.
* *
* @private * @private
* @param {Array} array The array to query. * @param {Array} array The array to modify.
* @param {string} key The key of the value to remove. * @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/ */

View File

@@ -1,4 +1,4 @@
define(['./assocIndexOf'], function(assocIndexOf) { define(['./_assocIndexOf'], function(assocIndexOf) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;

View File

@@ -1,4 +1,4 @@
define(['./assocIndexOf'], function(assocIndexOf) { define(['./_assocIndexOf'], function(assocIndexOf) {
/** /**
* Checks if an associative array value for `key` exists. * Checks if an associative array value for `key` exists.

View File

@@ -1,8 +1,7 @@
define(['../eq'], function(eq) { define(['./eq'], function(eq) {
/** /**
* Gets the index at which the first occurrence of `key` is found in `array` * Gets the index at which the `key` is found in `array` of key-value pairs.
* of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to search.

View File

@@ -1,4 +1,4 @@
define(['./assocIndexOf'], function(assocIndexOf) { define(['./_assocIndexOf'], function(assocIndexOf) {
/** /**
* Sets the associative array `key` to `value`. * Sets the associative array `key` to `value`.

22
_baseAggregator.js Normal file
View File

@@ -0,0 +1,22 @@
define(['./_baseEach'], function(baseEach) {
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed
* by `iteratee` and values set by `setter`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
}
return baseAggregator;
});

View File

@@ -1,4 +1,4 @@
define(['./copyObject', '../keys'], function(copyObject, keys) { define(['./_copyObject', './keys'], function(copyObject, keys) {
/** /**
* The base implementation of `_.assign` without support for multiple sources * The base implementation of `_.assign` without support for multiple sources

View File

@@ -1,4 +1,4 @@
define(['../get'], function(get) { define(['./get'], function(get) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;

View File

@@ -0,0 +1,15 @@
define(['./isArrayLikeObject'], function(isArrayLikeObject) {
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function baseCastArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
return baseCastArrayLikeObject;
});

15
_baseCastFunction.js Normal file
View File

@@ -0,0 +1,15 @@
define(['./identity'], function(identity) {
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function baseCastFunction(value) {
return typeof value == 'function' ? value : identity;
}
return baseCastFunction;
});

15
_baseCastKey.js Normal file
View File

@@ -0,0 +1,15 @@
define(['./isSymbol'], function(isSymbol) {
/**
* Casts `value` to a string if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the cast key.
*/
function baseCastKey(key) {
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
}
return baseCastKey;
});

15
_baseCastPath.js Normal file
View File

@@ -0,0 +1,15 @@
define(['./isArray', './_stringToPath'], function(isArray, stringToPath) {
/**
* 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);
}
return baseCastPath;
});

View File

@@ -1,4 +1,4 @@
define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn', './copyArray', './copySymbols', './getTag', './initCloneArray', './initCloneByTag', './initCloneObject', '../isArray', './isHostObject', '../isObject'], function(Stack, arrayEach, assignValue, baseAssign, baseForOwn, copyArray, copySymbols, getTag, initCloneArray, initCloneByTag, initCloneObject, isArray, isHostObject, isObject) { define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_cloneBuffer', './_copyArray', './_copySymbols', './_getAllKeys', './_getTag', './_initCloneArray', './_initCloneByTag', './_initCloneObject', './isArray', './isBuffer', './_isHostObject', './isObject', './keys'], function(Stack, arrayEach, assignValue, baseAssign, cloneBuffer, copyArray, copySymbols, getAllKeys, getTag, initCloneArray, initCloneByTag, initCloneObject, isArray, isBuffer, isHostObject, isObject, keys) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -21,6 +21,7 @@ define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn
weakMapTag = '[object WeakMap]'; weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]', var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]', float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]', float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]', int8Tag = '[object Int8Array]',
@@ -34,16 +35,16 @@ define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn
/** Used to identify `toStringTag` values supported by `_.clone`. */ /** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {}; var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint32Tag] = true; cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false; cloneableTags[weakMapTag] = false;
@@ -54,13 +55,14 @@ define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn
* @private * @private
* @param {*} value The value to clone. * @param {*} value The value to clone.
* @param {boolean} [isDeep] Specify a deep clone. * @param {boolean} [isDeep] Specify a deep clone.
* @param {boolean} [isFull] Specify a clone including symbols.
* @param {Function} [customizer] The function to customize cloning. * @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`. * @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`. * @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value. * @returns {*} Returns the cloned value.
*/ */
function baseClone(value, isDeep, customizer, key, object, stack) { function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
var result; var result;
if (customizer) { if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value); result = object ? customizer(value, key, object, stack) : customizer(value);
@@ -81,6 +83,9 @@ define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn
var tag = getTag(value), var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag; isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) { if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
if (isHostObject(value)) { if (isHostObject(value)) {
return object ? value : {}; return object ? value : {};
@@ -90,9 +95,10 @@ define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn
return copySymbols(value, baseAssign(result, value)); return copySymbols(value, baseAssign(result, value));
} }
} else { } else {
return cloneableTags[tag] if (!cloneableTags[tag]) {
? initCloneByTag(value, tag, isDeep) return object ? value : {};
: (object ? value : {}); }
result = initCloneByTag(value, tag, baseClone, isDeep);
} }
} }
// Check for circular references and return its corresponding clone. // Check for circular references and return its corresponding clone.
@@ -103,11 +109,18 @@ define(['./Stack', './arrayEach', './assignValue', './baseAssign', './baseForOwn
} }
stack.set(value, result); stack.set(value, result);
if (!isArr) {
var props = isFull ? getAllKeys(value) : keys(value);
}
// Recursively populate clone (susceptible to call stack limits). // Recursively populate clone (susceptible to call stack limits).
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { arrayEach(props || value, function(subValue, key) {
assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); if (props) {
key = subValue;
subValue = value[key];
}
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
}); });
return isArr ? result : copySymbols(value, result); return result;
} }
return baseClone; return baseClone;

View File

@@ -1,4 +1,4 @@
define(['../keys'], function(keys) { define(['./keys'], function(keys) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -24,7 +24,8 @@ define(['../keys'], function(keys) {
predicate = source[key], predicate = source[key],
value = object[key]; value = object[key];
if ((value === undefined && !(key in Object(object))) || !predicate(value)) { if ((value === undefined &&
!(key in Object(object))) || !predicate(value)) {
return false; return false;
} }
} }

19
_baseCreate.js Normal file
View File

@@ -0,0 +1,19 @@
define(['./isObject'], function(isObject) {
/** Built-in value references. */
var objectCreate = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} prototype The object to inherit from.
* @returns {Object} Returns the new object.
*/
function baseCreate(proto) {
return isObject(proto) ? objectCreate(proto) : {};
}
return baseCreate;
});

View File

@@ -13,7 +13,7 @@ define([], function() {
* @private * @private
* @param {Function} func The function to delay. * @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation. * @param {number} wait The number of milliseconds to delay invocation.
* @param {Object} args The arguments provide to `func`. * @param {Object} args The arguments to provide to `func`.
* @returns {number} Returns the timer id. * @returns {number} Returns the timer id.
*/ */
function baseDelay(func, wait, args) { function baseDelay(func, wait, args) {

View File

@@ -1,11 +1,11 @@
define(['./SetCache', './arrayIncludes', './arrayIncludesWith', './arrayMap', './baseUnary', './cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) { define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_arrayMap', './_baseUnary', './_cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) {
/** Used as the size to enable large array optimizations. */ /** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200; var LARGE_ARRAY_SIZE = 200;
/** /**
* The base implementation of methods like `_.difference` without support for * The base implementation of methods like `_.difference` without support
* excluding multiple arrays or iteratee shorthands. * for excluding multiple arrays or iteratee shorthands.
* *
* @private * @private
* @param {Array} array The array to inspect. * @param {Array} array The array to inspect.

View File

@@ -1,4 +1,4 @@
define(['./baseForOwn', './createBaseEach'], function(baseForOwn, createBaseEach) { define(['./_baseForOwn', './_createBaseEach'], function(baseForOwn, createBaseEach) {
/** /**
* The base implementation of `_.forEach` without support for iteratee shorthands. * The base implementation of `_.forEach` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
define(['./baseForOwnRight', './createBaseEach'], function(baseForOwnRight, createBaseEach) { define(['./_baseForOwnRight', './_createBaseEach'], function(baseForOwnRight, createBaseEach) {
/** /**
* The base implementation of `_.forEachRight` without support for iteratee shorthands. * The base implementation of `_.forEachRight` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
define(['./baseEach'], function(baseEach) { define(['./_baseEach'], function(baseEach) {
/** /**
* The base implementation of `_.every` without support for iteratee shorthands. * The base implementation of `_.every` without support for iteratee shorthands.
@@ -6,7 +6,8 @@ define(['./baseEach'], function(baseEach) {
* @private * @private
* @param {Array|Object} collection The collection to iterate over. * @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check, else `false` * @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`
*/ */
function baseEvery(collection, predicate) { function baseEvery(collection, predicate) {
var result = true; var result = true;

View File

@@ -1,4 +1,4 @@
define(['../toInteger', '../toLength'], function(toInteger, toLength) { define(['./toInteger', './toLength'], function(toInteger, toLength) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;

View File

@@ -1,4 +1,4 @@
define(['./baseEach'], function(baseEach) { define(['./_baseEach'], function(baseEach) {
/** /**
* The base implementation of `_.filter` without support for iteratee shorthands. * The base implementation of `_.filter` without support for iteratee shorthands.

View File

@@ -9,7 +9,8 @@ define([], function() {
* @param {Array|Object} collection The collection to search. * @param {Array|Object} collection The collection to search.
* @param {Function} predicate The function invoked per iteration. * @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`. * @param {Function} eachFunc The function to iterate over `collection`.
* @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. * @param {boolean} [retKey] Specify returning the key of the found element
* instead of the element itself.
* @returns {*} Returns the found element or its key, else `undefined`. * @returns {*} Returns the found element or its key, else `undefined`.
*/ */
function baseFind(collection, predicate, eachFunc, retKey) { function baseFind(collection, predicate, eachFunc, retKey) {

View File

@@ -1,16 +1,16 @@
define(['./arrayPush', '../isArguments', '../isArray', '../isArrayLikeObject'], function(arrayPush, isArguments, isArray, isArrayLikeObject) { define(['./_arrayPush', './isArguments', './isArray', './isArrayLikeObject'], function(arrayPush, isArguments, isArray, isArrayLikeObject) {
/** /**
* The base implementation of `_.flatten` with support for restricting flattening. * The base implementation of `_.flatten` with support for restricting flattening.
* *
* @private * @private
* @param {Array} array The array to flatten. * @param {Array} array The array to flatten.
* @param {boolean} [isDeep] Specify a deep flatten. * @param {number} depth The maximum recursion depth.
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects. * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
* @param {Array} [result=[]] The initial result value. * @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array. * @returns {Array} Returns the new flattened array.
*/ */
function baseFlatten(array, isDeep, isStrict, result) { function baseFlatten(array, depth, isStrict, result) {
result || (result = []); result || (result = []);
var index = -1, var index = -1,
@@ -18,11 +18,11 @@ define(['./arrayPush', '../isArguments', '../isArray', '../isArrayLikeObject'],
while (++index < length) { while (++index < length) {
var value = array[index]; var value = array[index];
if (isArrayLikeObject(value) && if (depth > 0 && isArrayLikeObject(value) &&
(isStrict || isArray(value) || isArguments(value))) { (isStrict || isArray(value) || isArguments(value))) {
if (isDeep) { if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits). // Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, isDeep, isStrict, result); baseFlatten(value, depth - 1, isStrict, result);
} else { } else {
arrayPush(result, value); arrayPush(result, value);
} }

View File

@@ -1,10 +1,9 @@
define(['./createBaseFor'], function(createBaseFor) { define(['./_createBaseFor'], function(createBaseFor) {
/** /**
* The base implementation of `baseForIn` and `baseForOwn` which iterates * The base implementation of `baseForOwn` which iterates over `object`
* over `object` properties returned by `keysFunc` invoking `iteratee` for * properties returned by `keysFunc` invoking `iteratee` for each property.
* each property. Iteratee functions may exit iteration early by explicitly * Iteratee functions may exit iteration early by explicitly returning `false`.
* returning `false`.
* *
* @private * @private
* @param {Object} object The object to iterate over. * @param {Object} object The object to iterate over.

View File

@@ -1,4 +1,4 @@
define(['./baseFor', '../keys'], function(baseFor, keys) { define(['./_baseFor', './keys'], function(baseFor, keys) {
/** /**
* The base implementation of `_.forOwn` without support for iteratee shorthands. * The base implementation of `_.forOwn` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
define(['./baseForRight', '../keys'], function(baseForRight, keys) { define(['./_baseForRight', './keys'], function(baseForRight, keys) {
/** /**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.

View File

@@ -1,4 +1,4 @@
define(['./createBaseFor'], function(createBaseFor) { define(['./_createBaseFor'], function(createBaseFor) {
/** /**
* This function is like `baseFor` except that it iterates over properties * This function is like `baseFor` except that it iterates over properties

View File

@@ -1,8 +1,8 @@
define(['./arrayFilter', '../isFunction'], function(arrayFilter, isFunction) { define(['./_arrayFilter', './isFunction'], function(arrayFilter, isFunction) {
/** /**
* The base implementation of `_.functions` which creates an array of * The base implementation of `_.functions` which creates an array of
* `object` function property names filtered from those provided. * `object` function property names filtered from `props`.
* *
* @private * @private
* @param {Object} object The object to inspect. * @param {Object} object The object to inspect.

View File

@@ -1,4 +1,4 @@
define(['./baseToPath', './isKey'], function(baseToPath, isKey) { define(['./_baseCastPath', './_isKey'], function(baseCastPath, isKey) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -12,7 +12,7 @@ define(['./baseToPath', './isKey'], function(baseToPath, isKey) {
* @returns {*} Returns the resolved value. * @returns {*} Returns the resolved value.
*/ */
function baseGet(object, path) { function baseGet(object, path) {
path = isKey(path, object) ? [path + ''] : baseToPath(path); path = isKey(path, object) ? [path] : baseCastPath(path);
var index = 0, var index = 0,
length = path.length; length = path.length;

22
_baseGetAllKeys.js Normal file
View File

@@ -0,0 +1,22 @@
define(['./_arrayPush', './isArray'], function(arrayPush, isArray) {
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object)
? result
: arrayPush(result, symbolsFunc(object));
}
return baseGetAllKeys;
});

View File

@@ -1,4 +1,4 @@
define([], function() { define(['./_getPrototype'], function(getPrototype) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto = Object.prototype; var objectProto = Object.prototype;
@@ -6,9 +6,6 @@ define([], function() {
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var getPrototypeOf = Object.getPrototypeOf;
/** /**
* The base implementation of `_.has` without support for deep paths. * The base implementation of `_.has` without support for deep paths.
* *
@@ -22,7 +19,7 @@ define([], function() {
// that are composed entirely of index properties, return `false` for // that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them. // `hasOwnProperty` checks of them.
return hasOwnProperty.call(object, key) || return hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null); (typeof object == 'object' && key in object && getPrototype(object) === null);
} }
return baseHas; return baseHas;

View File

@@ -1,4 +1,4 @@
define(['./indexOfNaN'], function(indexOfNaN) { define(['./_indexOfNaN'], function(indexOfNaN) {
/** /**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.

26
_baseIndexOfWith.js Normal file
View File

@@ -0,0 +1,26 @@
define([], function() {
/**
* This function is like `baseIndexOf` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @param {Function} comparator The comparator invoked per element.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOfWith(array, value, fromIndex, comparator) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (comparator(array[index], value)) {
return index;
}
}
return -1;
}
return baseIndexOfWith;
});

View File

@@ -1,8 +1,11 @@
define(['./SetCache', './arrayIncludes', './arrayIncludesWith', './arrayMap', './baseUnary', './cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) { define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_arrayMap', './_baseUnary', './_cacheHas'], function(SetCache, arrayIncludes, arrayIncludesWith, arrayMap, baseUnary, cacheHas) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/** /**
* The base implementation of methods like `_.intersection`, without support * The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect. * for iteratee shorthands, that accepts an array of arrays to inspect.
@@ -15,9 +18,11 @@ define(['./SetCache', './arrayIncludes', './arrayIncludesWith', './arrayMap', '.
*/ */
function baseIntersection(arrays, iteratee, comparator) { function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes, var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length, othLength = arrays.length,
othIndex = othLength, othIndex = othLength,
caches = Array(othLength), caches = Array(othLength),
maxLength = Infinity,
result = []; result = [];
while (othIndex--) { while (othIndex--) {
@@ -25,26 +30,32 @@ define(['./SetCache', './arrayIncludes', './arrayIncludesWith', './arrayMap', '.
if (othIndex && iteratee) { if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee)); array = arrayMap(array, baseUnary(iteratee));
} }
caches[othIndex] = !comparator && (iteratee || array.length >= 120) maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array) ? new SetCache(othIndex && array)
: undefined; : undefined;
} }
array = arrays[0]; array = arrays[0];
var index = -1, var index = -1,
length = array.length,
seen = caches[0]; seen = caches[0];
outer: outer:
while (++index < length) { while (++index < length && result.length < maxLength) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { if (!(seen
var othIndex = othLength; ? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) { while (--othIndex) {
var cache = caches[othIndex]; var cache = caches[othIndex];
if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer; continue outer;
} }
} }

22
_baseInverter.js Normal file
View File

@@ -0,0 +1,22 @@
define(['./_baseForOwn'], function(baseForOwn) {
/**
* The base implementation of `_.invert` and `_.invertBy` which inverts
* `object` with values transformed by `iteratee` and set by `setter`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform values.
* @param {Object} accumulator The initial inverted object.
* @returns {Function} Returns `accumulator`.
*/
function baseInverter(object, setter, iteratee, accumulator) {
baseForOwn(object, function(value, key, object) {
setter(accumulator, iteratee(value), key, object);
});
return accumulator;
}
return baseInverter;
});

View File

@@ -1,4 +1,4 @@
define(['./apply', './baseToPath', './isKey', '../last', './parent'], function(apply, baseToPath, isKey, last, parent) { define(['./_apply', './_baseCastPath', './_isKey', './last', './_parent'], function(apply, baseCastPath, isKey, last, parent) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -15,7 +15,7 @@ define(['./apply', './baseToPath', './isKey', '../last', './parent'], function(a
*/ */
function baseInvoke(object, path, args) { function baseInvoke(object, path, args) {
if (!isKey(path, object)) { if (!isKey(path, object)) {
path = baseToPath(path); path = baseCastPath(path);
object = parent(object, path); object = parent(object, path);
path = last(path); path = last(path);
} }

View File

@@ -1,4 +1,4 @@
define(['./baseIsEqualDeep', '../isObject', '../isObjectLike'], function(baseIsEqualDeep, isObject, isObjectLike) { define(['./_baseIsEqualDeep', './isObject', './isObjectLike'], function(baseIsEqualDeep, isObject, isObjectLike) {
/** /**
* The base implementation of `_.isEqual` which supports partial comparisons * The base implementation of `_.isEqual` which supports partial comparisons

View File

@@ -1,4 +1,4 @@
define(['./Stack', './equalArrays', './equalByTag', './equalObjects', './getTag', '../isArray', './isHostObject', '../isTypedArray'], function(Stack, equalArrays, equalByTag, equalObjects, getTag, isArray, isHostObject, isTypedArray) { define(['./_Stack', './_equalArrays', './_equalByTag', './_equalObjects', './_getTag', './isArray', './_isHostObject', './isTypedArray'], function(Stack, equalArrays, equalByTag, equalObjects, getTag, isArray, isHostObject, isTypedArray) {
/** Used to compose bitmasks for comparison styles. */ /** Used to compose bitmasks for comparison styles. */
var PARTIAL_COMPARE_FLAG = 2; var PARTIAL_COMPARE_FLAG = 2;
@@ -24,7 +24,8 @@ define(['./Stack', './equalArrays', './equalByTag', './equalObjects', './getTag'
* @param {Object} other The other object to compare. * @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons. * @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} [stack] Tracks traversed `object` and `other` objects. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/ */
@@ -36,41 +37,39 @@ define(['./Stack', './equalArrays', './equalByTag', './equalObjects', './getTag'
if (!objIsArr) { if (!objIsArr) {
objTag = getTag(object); objTag = getTag(object);
if (objTag == argsTag) { objTag = objTag == argsTag ? objectTag : objTag;
objTag = objectTag;
} else if (objTag != objectTag) {
objIsArr = isTypedArray(object);
}
} }
if (!othIsArr) { if (!othIsArr) {
othTag = getTag(other); othTag = getTag(other);
if (othTag == argsTag) { othTag = othTag == argsTag ? objectTag : othTag;
othTag = objectTag;
} else if (othTag != objectTag) {
othIsArr = isTypedArray(other);
}
} }
var objIsObj = objTag == objectTag && !isHostObject(object), var objIsObj = objTag == objectTag && !isHostObject(object),
othIsObj = othTag == objectTag && !isHostObject(other), othIsObj = othTag == objectTag && !isHostObject(other),
isSameTag = objTag == othTag; isSameTag = objTag == othTag;
if (isSameTag && !(objIsArr || objIsObj)) { if (isSameTag && !objIsObj) {
return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
: equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
} }
var isPartial = bitmask & PARTIAL_COMPARE_FLAG; if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
if (!isPartial) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) { if (objIsWrapped || othIsWrapped) {
return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
} }
} }
if (!isSameTag) { if (!isSameTag) {
return false; return false;
} }
stack || (stack = new Stack); stack || (stack = new Stack);
return (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack); return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
} }
return baseIsEqualDeep; return baseIsEqualDeep;

View File

@@ -1,4 +1,4 @@
define(['./Stack', './baseIsEqual'], function(Stack, baseIsEqual) { define(['./_Stack', './_baseIsEqual'], function(Stack, baseIsEqual) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -46,9 +46,10 @@ define(['./Stack', './baseIsEqual'], function(Stack, baseIsEqual) {
return false; return false;
} }
} else { } else {
var stack = new Stack, var stack = new Stack;
result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined if (!(result === undefined
? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
: result : result

View File

@@ -1,4 +1,4 @@
define(['./baseMatches', './baseMatchesProperty', '../identity', '../isArray', '../property'], function(baseMatches, baseMatchesProperty, identity, isArray, property) { define(['./_baseMatches', './_baseMatchesProperty', './identity', './isArray', './property'], function(baseMatches, baseMatchesProperty, identity, isArray, property) {
/** /**
* The base implementation of `_.iteratee`. * The base implementation of `_.iteratee`.
@@ -8,14 +8,15 @@ define(['./baseMatches', './baseMatchesProperty', '../identity', '../isArray', '
* @returns {Function} Returns the iteratee. * @returns {Function} Returns the iteratee.
*/ */
function baseIteratee(value) { function baseIteratee(value) {
var type = typeof value; // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
if (type == 'function') { // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value; return value;
} }
if (value == null) { if (value == null) {
return identity; return identity;
} }
if (type == 'object') { if (typeof value == 'object') {
return isArray(value) return isArray(value)
? baseMatchesProperty(value[0], value[1]) ? baseMatchesProperty(value[0], value[1])
: baseMatches(value); : baseMatches(value);

View File

@@ -8,7 +8,6 @@ define([], function() {
* property of prototypes or treat sparse arrays as dense. * property of prototypes or treat sparse arrays as dense.
* *
* @private * @private
* @type Function
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of property names. * @returns {Array} Returns the array of property names.
*/ */

View File

@@ -1,4 +1,4 @@
define(['./Reflect', './iteratorToArray'], function(Reflect, iteratorToArray) { define(['./_Reflect', './_iteratorToArray'], function(Reflect, iteratorToArray) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;

View File

@@ -1,7 +1,7 @@
define([], function() { define([], function() {
/** /**
* The function whose prototype all chaining wrappers inherit from. * The function whose prototype chain sequence wrappers inherit from.
* *
* @private * @private
*/ */

View File

@@ -1,4 +1,4 @@
define(['./baseEach', '../isArrayLike'], function(baseEach, isArrayLike) { define(['./_baseEach', './isArrayLike'], function(baseEach, isArrayLike) {
/** /**
* The base implementation of `_.map` without support for iteratee shorthands. * The base implementation of `_.map` without support for iteratee shorthands.

View File

@@ -1,7 +1,4 @@
define(['./baseIsMatch', './getMatchData'], function(baseIsMatch, getMatchData) { define(['./_baseIsMatch', './_getMatchData', './_matchesStrictComparable'], function(baseIsMatch, getMatchData, matchesStrictComparable) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** /**
* The base implementation of `_.matches` which doesn't clone `source`. * The base implementation of `_.matches` which doesn't clone `source`.
@@ -13,16 +10,7 @@ define(['./baseIsMatch', './getMatchData'], function(baseIsMatch, getMatchData)
function baseMatches(source) { function baseMatches(source) {
var matchData = getMatchData(source); var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) { if (matchData.length == 1 && matchData[0][2]) {
var key = matchData[0][0], return matchesStrictComparable(matchData[0][0], matchData[0][1]);
value = matchData[0][1];
return function(object) {
if (object == null) {
return false;
}
return object[key] === value &&
(value !== undefined || (key in Object(object)));
};
} }
return function(object) { return function(object) {
return object === source || baseIsMatch(object, source, matchData); return object === source || baseIsMatch(object, source, matchData);

View File

@@ -1,4 +1,4 @@
define(['./baseIsEqual', '../get', '../hasIn'], function(baseIsEqual, get, hasIn) { define(['./_baseIsEqual', './get', './hasIn', './_isKey', './_isStrictComparable', './_matchesStrictComparable'], function(baseIsEqual, get, hasIn, isKey, isStrictComparable, matchesStrictComparable) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -16,6 +16,9 @@ define(['./baseIsEqual', '../get', '../hasIn'], function(baseIsEqual, get, hasIn
* @returns {Function} Returns the new function. * @returns {Function} Returns the new function.
*/ */
function baseMatchesProperty(path, srcValue) { function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(path, srcValue);
}
return function(object) { return function(object) {
var objValue = get(object, path); var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue) return (objValue === undefined && objValue === srcValue)

21
_baseMean.js Normal file
View File

@@ -0,0 +1,21 @@
define(['./_baseSum'], function(baseSum) {
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/**
* The base implementation of `_.mean` and `_.meanBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the mean.
*/
function baseMean(array, iteratee) {
var length = array ? array.length : 0;
return length ? (baseSum(array, iteratee) / length) : NAN;
}
return baseMean;
});

View File

@@ -1,4 +1,4 @@
define(['./Stack', './arrayEach', './assignMergeValue', './baseMergeDeep', '../isArray', '../isObject', '../isTypedArray', '../keysIn'], function(Stack, arrayEach, assignMergeValue, baseMergeDeep, isArray, isObject, isTypedArray, keysIn) { define(['./_Stack', './_arrayEach', './_assignMergeValue', './_baseMergeDeep', './isArray', './isObject', './isTypedArray', './keysIn'], function(Stack, arrayEach, assignMergeValue, baseMergeDeep, isArray, isObject, isTypedArray, keysIn) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -11,13 +11,16 @@ define(['./Stack', './arrayEach', './assignMergeValue', './baseMergeDeep', '../i
* @param {Object} source The source object. * @param {Object} source The source object.
* @param {number} srcIndex The index of `source`. * @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values. * @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged counterparts. * @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/ */
function baseMerge(object, source, srcIndex, customizer, stack) { function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) { if (object === source) {
return; return;
} }
var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source); if (!(isArray(source) || isTypedArray(source))) {
var props = keysIn(source);
}
arrayEach(props || source, function(srcValue, key) { arrayEach(props || source, function(srcValue, key) {
if (props) { if (props) {
key = srcValue; key = srcValue;
@@ -28,7 +31,10 @@ define(['./Stack', './arrayEach', './assignMergeValue', './baseMergeDeep', '../i
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
} }
else { else {
var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined; var newValue = customizer
? customizer(object[key], srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = srcValue; newValue = srcValue;
} }

View File

@@ -1,4 +1,4 @@
define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '../isArray', '../isArrayLikeObject', '../isFunction', '../isObject', '../isPlainObject', '../isTypedArray', '../toPlainObject'], function(assignMergeValue, baseClone, copyArray, isArguments, isArray, isArrayLikeObject, isFunction, isObject, isPlainObject, isTypedArray, toPlainObject) { define(['./_assignMergeValue', './_baseClone', './_copyArray', './isArguments', './isArray', './isArrayLikeObject', './isFunction', './isObject', './isPlainObject', './isTypedArray', './toPlainObject'], function(assignMergeValue, baseClone, copyArray, isArguments, isArray, isArrayLikeObject, isFunction, isObject, isPlainObject, isTypedArray, toPlainObject) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined; var undefined;
@@ -15,31 +15,36 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
* @param {number} srcIndex The index of `source`. * @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values. * @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values. * @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged counterparts. * @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/ */
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key], var objValue = object[key],
srcValue = source[key], srcValue = source[key],
stacked = stack.get(srcValue) || stack.get(objValue); stacked = stack.get(srcValue);
if (stacked) { if (stacked) {
assignMergeValue(object, key, stacked); assignMergeValue(object, key, stacked);
return; return;
} }
var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined, var newValue = customizer
isCommon = newValue === undefined; ? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) { if (isCommon) {
newValue = srcValue; newValue = srcValue;
if (isArray(srcValue) || isTypedArray(srcValue)) { if (isArray(srcValue) || isTypedArray(srcValue)) {
if (isArray(objValue)) { if (isArray(objValue)) {
newValue = srcIndex ? copyArray(objValue) : objValue; newValue = objValue;
} }
else if (isArrayLikeObject(objValue)) { else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue); newValue = copyArray(objValue);
} }
else { else {
newValue = baseClone(srcValue); isCommon = false;
newValue = baseClone(srcValue, true);
} }
} }
else if (isPlainObject(srcValue) || isArguments(srcValue)) { else if (isPlainObject(srcValue) || isArguments(srcValue)) {
@@ -47,10 +52,11 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
newValue = toPlainObject(objValue); newValue = toPlainObject(objValue);
} }
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
newValue = baseClone(srcValue); isCommon = false;
newValue = baseClone(srcValue, true);
} }
else { else {
newValue = srcIndex ? baseClone(objValue) : objValue; newValue = objValue;
} }
} }
else { else {
@@ -63,6 +69,7 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
// Recursively merge objects and arrays (susceptible to call stack limits). // Recursively merge objects and arrays (susceptible to call stack limits).
mergeFunc(newValue, srcValue, srcIndex, customizer, stack); mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
} }
stack['delete'](srcValue);
assignMergeValue(object, key, newValue); assignMergeValue(object, key, newValue);
} }

View File

@@ -1,4 +1,4 @@
define(['./arrayMap', './baseIteratee', './baseMap', './baseSortBy', './compareMultiple'], function(arrayMap, baseIteratee, baseMap, baseSortBy, compareMultiple) { define(['./_arrayMap', './_baseIteratee', './_baseMap', './_baseSortBy', './_compareMultiple', './identity'], function(arrayMap, baseIteratee, baseMap, baseSortBy, compareMultiple, identity) {
/** /**
* The base implementation of `_.orderBy` without param guards. * The base implementation of `_.orderBy` without param guards.
@@ -10,12 +10,8 @@ define(['./arrayMap', './baseIteratee', './baseMap', './baseSortBy', './compareM
* @returns {Array} Returns the new sorted array. * @returns {Array} Returns the new sorted array.
*/ */
function baseOrderBy(collection, iteratees, orders) { function baseOrderBy(collection, iteratees, orders) {
var index = -1, var index = -1;
toIteratee = baseIteratee; iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseIteratee);
iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) {
return toIteratee(iteratee);
});
var result = baseMap(collection, function(value, key, collection) { var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) { var criteria = arrayMap(iteratees, function(iteratee) {

View File

@@ -1,12 +1,12 @@
define(['./arrayReduce'], function(arrayReduce) { define(['./_arrayReduce'], function(arrayReduce) {
/** /**
* The base implementation of `_.pick` without support for individual * The base implementation of `_.pick` without support for individual
* property names. * property identifiers.
* *
* @private * @private
* @param {Object} object The source object. * @param {Object} object The source object.
* @param {string[]} props The property names to pick. * @param {string[]} props The property identifiers to pick.
* @returns {Object} Returns the new object. * @returns {Object} Returns the new object.
*/ */
function basePick(object, props) { function basePick(object, props) {

View File

@@ -1,4 +1,4 @@
define(['./baseForIn'], function(baseForIn) { define(['./_getAllKeysIn'], function(getAllKeysIn) {
/** /**
* The base implementation of `_.pickBy` without support for iteratee shorthands. * The base implementation of `_.pickBy` without support for iteratee shorthands.
@@ -9,12 +9,19 @@ define(['./baseForIn'], function(baseForIn) {
* @returns {Object} Returns the new object. * @returns {Object} Returns the new object.
*/ */
function basePickBy(object, predicate) { function basePickBy(object, predicate) {
var result = {}; var index = -1,
baseForIn(object, function(value, key) { props = getAllKeysIn(object),
length = props.length,
result = {};
while (++index < length) {
var key = props[index],
value = object[key];
if (predicate(value, key)) { if (predicate(value, key)) {
result[key] = value; result[key] = value;
} }
}); }
return result; return result;
} }

View File

@@ -1,4 +1,4 @@
define(['./baseGet'], function(baseGet) { define(['./_baseGet'], function(baseGet) {
/** /**
* A specialized version of `baseProperty` which supports deep paths. * A specialized version of `baseProperty` which supports deep paths.

View File

@@ -1,4 +1,4 @@
define(['./arrayMap', './baseIndexOf'], function(arrayMap, baseIndexOf) { define(['./_arrayMap', './_baseIndexOf', './_baseIndexOfWith', './_baseUnary'], function(arrayMap, baseIndexOf, baseIndexOfWith, baseUnary) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype; var arrayProto = Array.prototype;
@@ -14,22 +14,24 @@ define(['./arrayMap', './baseIndexOf'], function(arrayMap, baseIndexOf) {
* @param {Array} array The array to modify. * @param {Array} array The array to modify.
* @param {Array} values The values to remove. * @param {Array} values The values to remove.
* @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`. * @returns {Array} Returns `array`.
*/ */
function basePullAllBy(array, values, iteratee) { function basePullAll(array, values, iteratee, comparator) {
var index = -1, var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
index = -1,
length = values.length, length = values.length,
seen = array; seen = array;
if (iteratee) { if (iteratee) {
seen = arrayMap(array, function(value) { return iteratee(value); }); seen = arrayMap(array, baseUnary(iteratee));
} }
while (++index < length) { while (++index < length) {
var fromIndex = 0, var fromIndex = 0,
value = values[index], value = values[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) { while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
if (seen !== array) { if (seen !== array) {
splice.call(seen, fromIndex, 1); splice.call(seen, fromIndex, 1);
} }
@@ -39,5 +41,5 @@ define(['./arrayMap', './baseIndexOf'], function(arrayMap, baseIndexOf) {
return array; return array;
} }
return basePullAllBy; return basePullAll;
}); });

View File

@@ -1,4 +1,4 @@
define(['./baseToPath', './isIndex', './isKey', '../last', './parent'], function(baseToPath, isIndex, isKey, last, parent) { define(['./_baseCastPath', './_isIndex', './_isKey', './last', './_parent'], function(baseCastPath, isIndex, isKey, last, parent) {
/** Used for built-in method references. */ /** Used for built-in method references. */
var arrayProto = Array.prototype; var arrayProto = Array.prototype;
@@ -27,7 +27,7 @@ define(['./baseToPath', './isIndex', './isKey', '../last', './parent'], function
splice.call(array, index, 1); splice.call(array, index, 1);
} }
else if (!isKey(index, array)) { else if (!isKey(index, array)) {
var path = baseToPath(index), var path = baseCastPath(index),
object = parent(array, path); object = parent(array, path);
if (object != null) { if (object != null) {

View File

@@ -8,7 +8,8 @@ define([], function() {
* @param {Array|Object} collection The collection to iterate over. * @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration. * @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value. * @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. * @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`. * @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value. * @returns {*} Returns the accumulated value.
*/ */

Some files were not shown because too many files have changed in this diff Show More