mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ca813254d | ||
|
|
7293d39642 | ||
|
|
629caa8340 |
@@ -1,4 +1,4 @@
|
||||
# lodash-amd v4.0.0
|
||||
# lodash-amd v4.2.0
|
||||
|
||||
The [lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
||||
|
||||
@@ -27,4 +27,4 @@ require({
|
||||
});
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.0.0-amd) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.2.0-amd) for more details.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./nativeCreate'], function(nativeCreate) {
|
||||
define(['./_nativeCreate'], function(nativeCreate) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
@@ -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. */
|
||||
var MAX_ARRAY_LENGTH = 4294967295;
|
||||
@@ -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. */
|
||||
var undefined;
|
||||
@@ -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. */
|
||||
var Map = getNative(root, 'Map');
|
||||
@@ -1,4 +1,4 @@
|
||||
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.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./root'], function(root) {
|
||||
define(['./_root'], function(root) {
|
||||
|
||||
/** Built-in value references. */
|
||||
var Reflect = root.Reflect;
|
||||
@@ -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. */
|
||||
var Set = getNative(root, 'Set');
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./MapCache', './cachePush'], function(MapCache, cachePush) {
|
||||
define(['./_MapCache', './_cachePush'], function(MapCache, cachePush) {
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,4 +1,4 @@
|
||||
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.
|
||||
7
_Symbol.js
Normal file
7
_Symbol.js
Normal file
@@ -0,0 +1,7 @@
|
||||
define(['./_root'], function(root) {
|
||||
|
||||
/** Built-in value references. */
|
||||
var Symbol = root.Symbol;
|
||||
|
||||
return Symbol;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./root'], function(root) {
|
||||
define(['./_root'], function(root) {
|
||||
|
||||
/** Built-in value references. */
|
||||
var Uint8Array = root.Uint8Array;
|
||||
@@ -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. */
|
||||
var WeakMap = getNative(root, 'WeakMap');
|
||||
@@ -7,11 +7,11 @@ define([], function() {
|
||||
* @private
|
||||
* @param {Function} func The function to invoke.
|
||||
* @param {*} thisArg The `this` binding of `func`.
|
||||
* @param {...*} [args] The arguments to invoke `func` with.
|
||||
* @param {...*} args The arguments to invoke `func` with.
|
||||
* @returns {*} Returns the result of `func`.
|
||||
*/
|
||||
function apply(func, thisArg, args) {
|
||||
var length = args ? args.length : 0;
|
||||
var length = args.length;
|
||||
switch (length) {
|
||||
case 0: return func.call(thisArg);
|
||||
case 1: return func.call(thisArg, args[0]);
|
||||
25
_arrayAggregator.js
Normal file
25
_arrayAggregator.js
Normal 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;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseIndexOf'], function(baseIndexOf) {
|
||||
define(['./_baseIndexOf'], function(baseIndexOf) {
|
||||
|
||||
/**
|
||||
* A specialized version of `_.includes` for arrays without support for
|
||||
@@ -8,14 +8,14 @@ define([], function() {
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {*} [accumulator] The initial value.
|
||||
* @param {boolean} [initFromArray] 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.
|
||||
*/
|
||||
function arrayReduce(array, iteratee, accumulator, initFromArray) {
|
||||
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
|
||||
if (initFromArray && length) {
|
||||
if (initAccum && length) {
|
||||
accumulator = array[++index];
|
||||
}
|
||||
while (++index < length) {
|
||||
@@ -8,12 +8,12 @@ define([], function() {
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {*} [accumulator] The initial value.
|
||||
* @param {boolean} [initFromArray] 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.
|
||||
*/
|
||||
function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
|
||||
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
|
||||
var length = array.length;
|
||||
if (initFromArray && length) {
|
||||
if (initAccum && length) {
|
||||
accumulator = array[--length];
|
||||
}
|
||||
while (length--) {
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../eq'], function(eq) {
|
||||
define(['./eq'], function(eq) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../eq'], function(eq) {
|
||||
define(['./eq'], function(eq) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../eq'], function(eq) {
|
||||
define(['./eq'], function(eq) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./assocIndexOf'], function(assocIndexOf) {
|
||||
define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./assocIndexOf'], function(assocIndexOf) {
|
||||
define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./assocIndexOf'], function(assocIndexOf) {
|
||||
define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/**
|
||||
* Checks if an associative array value for `key` exists.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../eq'], function(eq) {
|
||||
define(['./eq'], function(eq) {
|
||||
|
||||
/**
|
||||
* Gets the index at which the first occurrence of `key` is found in `array`
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./assocIndexOf'], function(assocIndexOf) {
|
||||
define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/**
|
||||
* Sets the associative array `key` to `value`.
|
||||
22
_baseAggregator.js
Normal file
22
_baseAggregator.js
Normal 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;
|
||||
});
|
||||
@@ -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
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../get'], function(get) {
|
||||
define(['./get'], function(get) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -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', './_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) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../keys'], function(keys) {
|
||||
define(['./keys'], function(keys) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../isObject'], function(isObject) {
|
||||
define(['./isObject'], function(isObject) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
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. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseEach'], function(baseEach) {
|
||||
define(['./_baseEach'], function(baseEach) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.every` without support for iteratee shorthands.
|
||||
@@ -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. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseEach'], function(baseEach) {
|
||||
define(['./_baseEach'], function(baseEach) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.filter` without support for iteratee shorthands.
|
||||
@@ -3,7 +3,7 @@ define([], function() {
|
||||
/**
|
||||
* The base implementation of methods like `_.find` and `_.findKey`, without
|
||||
* support for iteratee shorthands, which iterates over `collection` using
|
||||
* the provided `eachFunc`.
|
||||
* `eachFunc`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} collection The collection to search.
|
||||
@@ -1,4 +1,4 @@
|
||||
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.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./createBaseFor'], function(createBaseFor) {
|
||||
define(['./_createBaseFor'], function(createBaseFor) {
|
||||
|
||||
/**
|
||||
* The base implementation of `baseForIn` and `baseForOwn` which iterates
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseFor', '../keysIn'], function(baseFor, keysIn) {
|
||||
define(['./_baseFor', './keysIn'], function(baseFor, keysIn) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.forIn` without support for iteratee shorthands.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./createBaseFor'], function(createBaseFor) {
|
||||
define(['./_createBaseFor'], function(createBaseFor) {
|
||||
|
||||
/**
|
||||
* This function is like `baseFor` except that it iterates over properties
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./arrayFilter', '../isFunction'], function(arrayFilter, isFunction) {
|
||||
define(['./_arrayFilter', './isFunction'], function(arrayFilter, isFunction) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.functions` which creates an array of
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseToPath', './isKey'], function(baseToPath, isKey) {
|
||||
define(['./_baseToPath', './_isKey'], function(baseToPath, isKey) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./indexOfNaN'], function(indexOfNaN) {
|
||||
define(['./_indexOfNaN'], function(indexOfNaN) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
||||
@@ -1,4 +1,4 @@
|
||||
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. */
|
||||
var undefined;
|
||||
22
_baseInverter.js
Normal file
22
_baseInverter.js
Normal 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;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./apply', './baseToPath', './isKey', '../last', './parent'], function(apply, baseToPath, isKey, last, parent) {
|
||||
define(['./_apply', './_baseToPath', './_isKey', './last', './_parent'], function(apply, baseToPath, isKey, last, parent) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -7,7 +7,6 @@ define(['./apply', './baseToPath', './isKey', '../last', './parent'], function(a
|
||||
* The base implementation of `_.invoke` without support for individual
|
||||
* method arguments.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array|string} path The path of the method to invoke.
|
||||
@@ -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
|
||||
@@ -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. */
|
||||
var PARTIAL_COMPARE_FLAG = 2;
|
||||
@@ -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. */
|
||||
var undefined;
|
||||
@@ -49,7 +49,10 @@ define(['./Stack', './baseIsEqual'], function(Stack, baseIsEqual) {
|
||||
var stack = new Stack,
|
||||
result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;
|
||||
|
||||
if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
|
||||
if (!(result === undefined
|
||||
? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
|
||||
: result
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -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`.
|
||||
@@ -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. */
|
||||
var undefined;
|
||||
@@ -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.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseIsMatch', './getMatchData'], function(baseIsMatch, getMatchData) {
|
||||
define(['./_baseIsMatch', './_getMatchData'], function(baseIsMatch, getMatchData) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseIsEqual', '../get', '../hasIn'], function(baseIsEqual, get, hasIn) {
|
||||
define(['./_baseIsEqual', './get', './hasIn'], function(baseIsEqual, get, hasIn) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -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. */
|
||||
var undefined;
|
||||
@@ -9,10 +9,11 @@ define(['./Stack', './arrayEach', './assignMergeValue', './baseMergeDeep', '../i
|
||||
* @private
|
||||
* @param {Object} object The destination object.
|
||||
* @param {Object} source The source object.
|
||||
* @param {number} srcIndex The index of `source`.
|
||||
* @param {Function} [customizer] The function to customize merged values.
|
||||
* @param {Object} [stack] Tracks traversed source values and their merged counterparts.
|
||||
*/
|
||||
function baseMerge(object, source, customizer, stack) {
|
||||
function baseMerge(object, source, srcIndex, customizer, stack) {
|
||||
if (object === source) {
|
||||
return;
|
||||
}
|
||||
@@ -24,7 +25,7 @@ define(['./Stack', './arrayEach', './assignMergeValue', './baseMergeDeep', '../i
|
||||
}
|
||||
if (isObject(srcValue)) {
|
||||
stack || (stack = new Stack);
|
||||
baseMergeDeep(object, source, key, baseMerge, customizer, stack);
|
||||
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
||||
}
|
||||
else {
|
||||
var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined;
|
||||
@@ -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. */
|
||||
var undefined;
|
||||
@@ -12,14 +12,15 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
|
||||
* @param {Object} object The destination object.
|
||||
* @param {Object} source The source object.
|
||||
* @param {string} key The key of the value to merge.
|
||||
* @param {number} srcIndex The index of `source`.
|
||||
* @param {Function} mergeFunc The function to merge values.
|
||||
* @param {Function} [customizer] The function to customize assigned values.
|
||||
* @param {Object} [stack] Tracks traversed source values and their merged counterparts.
|
||||
*/
|
||||
function baseMergeDeep(object, source, key, mergeFunc, customizer, stack) {
|
||||
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
||||
var objValue = object[key],
|
||||
srcValue = source[key],
|
||||
stacked = stack.get(srcValue) || stack.get(objValue);
|
||||
stacked = stack.get(srcValue);
|
||||
|
||||
if (stacked) {
|
||||
assignMergeValue(object, key, stacked);
|
||||
@@ -31,24 +32,38 @@ define(['./assignMergeValue', './baseClone', './copyArray', '../isArguments', '.
|
||||
if (isCommon) {
|
||||
newValue = srcValue;
|
||||
if (isArray(srcValue) || isTypedArray(srcValue)) {
|
||||
newValue = isArray(objValue)
|
||||
? objValue
|
||||
: ((isArrayLikeObject(objValue)) ? copyArray(objValue) : baseClone(srcValue));
|
||||
if (isArray(objValue)) {
|
||||
newValue = srcIndex ? copyArray(objValue) : objValue;
|
||||
}
|
||||
else if (isArrayLikeObject(objValue)) {
|
||||
newValue = copyArray(objValue);
|
||||
}
|
||||
else {
|
||||
isCommon = false;
|
||||
newValue = baseClone(srcValue);
|
||||
}
|
||||
}
|
||||
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||
newValue = isArguments(objValue)
|
||||
? toPlainObject(objValue)
|
||||
: (isObject(objValue) ? objValue : baseClone(srcValue));
|
||||
if (isArguments(objValue)) {
|
||||
newValue = toPlainObject(objValue);
|
||||
}
|
||||
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
||||
isCommon = false;
|
||||
newValue = baseClone(srcValue);
|
||||
}
|
||||
else {
|
||||
newValue = srcIndex ? baseClone(objValue) : objValue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
isCommon = isFunction(srcValue);
|
||||
isCommon = false;
|
||||
}
|
||||
}
|
||||
stack.set(srcValue, newValue);
|
||||
|
||||
if (isCommon) {
|
||||
// Recursively merge objects and arrays (susceptible to call stack limits).
|
||||
mergeFunc(newValue, srcValue, customizer, stack);
|
||||
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
||||
}
|
||||
assignMergeValue(object, key, newValue);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./arrayMap', './baseIteratee', './baseMap', './baseSortBy', './compareMultiple'], function(arrayMap, baseIteratee, baseMap, baseSortBy, compareMultiple) {
|
||||
define(['./_arrayMap', './_baseIteratee', './_baseMap', './_baseSortBy', './_compareMultiple'], function(arrayMap, baseIteratee, baseMap, baseSortBy, compareMultiple) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.orderBy` without param guards.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./arrayReduce'], function(arrayReduce) {
|
||||
define(['./_arrayReduce'], function(arrayReduce) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pick` without support for individual
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseForIn'], function(baseForIn) {
|
||||
define(['./_baseForIn'], function(baseForIn) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pickBy` without support for iteratee shorthands.
|
||||
@@ -11,7 +11,7 @@ define(['./baseForIn'], function(baseForIn) {
|
||||
function basePickBy(object, predicate) {
|
||||
var result = {};
|
||||
baseForIn(object, function(value, key) {
|
||||
if (predicate(value)) {
|
||||
if (predicate(value, key)) {
|
||||
result[key] = value;
|
||||
}
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseGet'], function(baseGet) {
|
||||
define(['./_baseGet'], function(baseGet) {
|
||||
|
||||
/**
|
||||
* A specialized version of `baseProperty` which supports deep paths.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./basePullAllBy'], function(basePullAllBy) {
|
||||
define(['./_basePullAllBy'], function(basePullAllBy) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pullAll`.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./arrayMap', './baseIndexOf'], function(arrayMap, baseIndexOf) {
|
||||
define(['./_arrayMap', './_baseIndexOf'], function(arrayMap, baseIndexOf) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseToPath', './isIndex', './isKey', '../last', './parent'], function(baseToPath, isIndex, isKey, last, parent) {
|
||||
define(['./_baseToPath', './_isIndex', './_isKey', './last', './_parent'], function(baseToPath, isIndex, isKey, last, parent) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
@@ -2,21 +2,20 @@ define([], function() {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.reduce` and `_.reduceRight`, without support
|
||||
* for iteratee shorthands, which iterates over `collection` using the provided
|
||||
* `eachFunc`.
|
||||
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {*} accumulator The initial value.
|
||||
* @param {boolean} initFromCollection 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`.
|
||||
* @returns {*} Returns the accumulated value.
|
||||
*/
|
||||
function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
|
||||
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
|
||||
eachFunc(collection, function(value, index, collection) {
|
||||
accumulator = initFromCollection
|
||||
? (initFromCollection = false, value)
|
||||
accumulator = initAccum
|
||||
? (initAccum = false, value)
|
||||
: iteratee(accumulator, value, index, collection);
|
||||
});
|
||||
return accumulator;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./assignValue', './baseToPath', './isIndex', './isKey', '../isObject'], function(assignValue, baseToPath, isIndex, isKey, isObject) {
|
||||
define(['./_assignValue', './_baseToPath', './_isIndex', './_isKey', './isObject'], function(assignValue, baseToPath, isIndex, isKey, isObject) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../identity', './metaMap'], function(identity, metaMap) {
|
||||
define(['./identity', './_metaMap'], function(identity, metaMap) {
|
||||
|
||||
/**
|
||||
* The base implementation of `setData` without support for hot loop detection.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseEach'], function(baseEach) {
|
||||
define(['./_baseEach'], function(baseEach) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.some` without support for iteratee shorthands.
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseSortedIndexBy', '../identity'], function(baseSortedIndexBy, identity) {
|
||||
define(['./_baseSortedIndexBy', './identity'], function(baseSortedIndexBy, identity) {
|
||||
|
||||
/** Used as references for the maximum length and index of an array. */
|
||||
var MAX_ARRAY_LENGTH = 4294967295,
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./baseSortedUniqBy'], function(baseSortedUniqBy) {
|
||||
define(['./_baseSortedUniqBy'], function(baseSortedUniqBy) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.sortedUniq`.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user