mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8166b65853 | ||
|
|
65e5d998b3 |
@@ -1,4 +1,4 @@
|
||||
# lodash-amd v4.5.0
|
||||
# lodash-amd v4.6.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.5.0-amd) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.6.0-amd) for more details.
|
||||
|
||||
@@ -9,6 +9,7 @@ define([], function() {
|
||||
* @returns {Object} Returns `map`.
|
||||
*/
|
||||
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]);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ define([], function() {
|
||||
function arrayFilter(array, predicate) {
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
resIndex = -1,
|
||||
resIndex = 0,
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (predicate(value, index, array)) {
|
||||
result[++resIndex] = value;
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* A specialized version of `_.includesWith` for arrays without support for
|
||||
* specifying an index to search from.
|
||||
* This function is like `arrayIncludes` except that it accepts a comparator.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to search.
|
||||
|
||||
@@ -4,7 +4,8 @@ define(['./eq'], function(eq) {
|
||||
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
|
||||
* @param {Object} object The object to modify.
|
||||
|
||||
@@ -21,8 +21,7 @@ define(['./eq'], function(eq) {
|
||||
*/
|
||||
function assignValue(object, key, value) {
|
||||
var objValue = object[key];
|
||||
if ((!eq(objValue, value) ||
|
||||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
|
||||
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
||||
(value === undefined && !(key in object))) {
|
||||
object[key] = value;
|
||||
}
|
||||
|
||||
26
_baseIndexOfWith.js
Normal file
26
_baseIndexOfWith.js
Normal 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;
|
||||
});
|
||||
@@ -3,6 +3,9 @@ define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_arrayMap'
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
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
|
||||
* 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) {
|
||||
var includes = comparator ? arrayIncludesWith : arrayIncludes,
|
||||
length = arrays[0].length,
|
||||
othLength = arrays.length,
|
||||
othIndex = othLength,
|
||||
caches = Array(othLength),
|
||||
maxLength = Infinity,
|
||||
result = [];
|
||||
|
||||
while (othIndex--) {
|
||||
@@ -25,18 +30,18 @@ define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_arrayMap'
|
||||
if (othIndex && 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)
|
||||
: undefined;
|
||||
}
|
||||
array = arrays[0];
|
||||
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
seen = caches[0];
|
||||
|
||||
outer:
|
||||
while (++index < length) {
|
||||
while (++index < length && result.length < maxLength) {
|
||||
var value = array[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
@@ -44,7 +49,7 @@ define(['./_SetCache', './_arrayIncludes', './_arrayIncludesWith', './_arrayMap'
|
||||
? cacheHas(seen, computed)
|
||||
: includes(result, computed, comparator)
|
||||
)) {
|
||||
var othIndex = othLength;
|
||||
othIndex = othLength;
|
||||
while (--othIndex) {
|
||||
var cache = caches[othIndex];
|
||||
if (!(cache
|
||||
|
||||
@@ -36,33 +36,28 @@ define(['./_Stack', './_equalArrays', './_equalByTag', './_equalObjects', './_ge
|
||||
|
||||
if (!objIsArr) {
|
||||
objTag = getTag(object);
|
||||
if (objTag == argsTag) {
|
||||
objTag = objectTag;
|
||||
} else if (objTag != objectTag) {
|
||||
objIsArr = isTypedArray(object);
|
||||
}
|
||||
objTag = objTag == argsTag ? objectTag : objTag;
|
||||
}
|
||||
if (!othIsArr) {
|
||||
othTag = getTag(other);
|
||||
if (othTag == argsTag) {
|
||||
othTag = objectTag;
|
||||
} else if (othTag != objectTag) {
|
||||
othIsArr = isTypedArray(other);
|
||||
}
|
||||
othTag = othTag == argsTag ? objectTag : othTag;
|
||||
}
|
||||
var objIsObj = objTag == objectTag && !isHostObject(object),
|
||||
othIsObj = othTag == objectTag && !isHostObject(other),
|
||||
isSameTag = objTag == othTag;
|
||||
|
||||
if (isSameTag && !(objIsArr || objIsObj)) {
|
||||
return equalByTag(object, other, objTag, equalFunc, customizer, bitmask);
|
||||
if (isSameTag && !objIsObj) {
|
||||
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 (!isPartial) {
|
||||
if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
|
||||
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
||||
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
||||
|
||||
if (objIsWrapped || othIsWrapped) {
|
||||
stack || (stack = new Stack);
|
||||
return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);
|
||||
}
|
||||
}
|
||||
@@ -70,7 +65,7 @@ define(['./_Stack', './_equalArrays', './_equalByTag', './_equalObjects', './_ge
|
||||
return false;
|
||||
}
|
||||
stack || (stack = new Stack);
|
||||
return (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack);
|
||||
return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
|
||||
}
|
||||
|
||||
return baseIsEqualDeep;
|
||||
|
||||
@@ -43,7 +43,7 @@ define(['./_assignMergeValue', './_baseClone', './_copyArray', './isArguments',
|
||||
}
|
||||
else {
|
||||
isCommon = false;
|
||||
newValue = baseClone(srcValue, true);
|
||||
newValue = baseClone(srcValue, !customizer);
|
||||
}
|
||||
}
|
||||
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||
@@ -52,7 +52,7 @@ define(['./_assignMergeValue', './_baseClone', './_copyArray', './isArguments',
|
||||
}
|
||||
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
||||
isCommon = false;
|
||||
newValue = baseClone(srcValue, true);
|
||||
newValue = baseClone(srcValue, !customizer);
|
||||
}
|
||||
else {
|
||||
newValue = objValue;
|
||||
@@ -68,6 +68,7 @@ define(['./_assignMergeValue', './_baseClone', './_copyArray', './isArguments',
|
||||
// Recursively merge objects and arrays (susceptible to call stack limits).
|
||||
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
||||
}
|
||||
stack['delete'](srcValue);
|
||||
assignMergeValue(object, key, newValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,8 @@ define(['./_arrayMap', './_baseIteratee', './_baseMap', './_baseSortBy', './_com
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
*/
|
||||
function baseOrderBy(collection, iteratees, orders) {
|
||||
var index = -1,
|
||||
toIteratee = baseIteratee;
|
||||
|
||||
iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) {
|
||||
return toIteratee(iteratee);
|
||||
});
|
||||
var index = -1;
|
||||
iteratees = arrayMap(iteratees.length ? iteratees : Array(1), baseIteratee);
|
||||
|
||||
var result = baseMap(collection, function(value, key, collection) {
|
||||
var criteria = arrayMap(iteratees, function(iteratee) {
|
||||
|
||||
@@ -1,15 +1,44 @@
|
||||
define(['./_basePullAllBy'], function(basePullAllBy) {
|
||||
define(['./_arrayMap', './_baseIndexOf', './_baseIndexOfWith', './_baseUnary'], function(arrayMap, baseIndexOf, baseIndexOfWith, baseUnary) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
|
||||
/** Built-in value references. */
|
||||
var splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pullAll`.
|
||||
* The base implementation of `_.pullAllBy` without support for iteratee
|
||||
* shorthands.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Array} values The values to remove.
|
||||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function basePullAll(array, values) {
|
||||
return basePullAllBy(array, values);
|
||||
function basePullAll(array, values, iteratee, comparator) {
|
||||
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
|
||||
index = -1,
|
||||
length = values.length,
|
||||
seen = array;
|
||||
|
||||
if (iteratee) {
|
||||
seen = arrayMap(array, baseUnary(iteratee));
|
||||
}
|
||||
while (++index < length) {
|
||||
var fromIndex = 0,
|
||||
value = values[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
|
||||
if (seen !== array) {
|
||||
splice.call(seen, fromIndex, 1);
|
||||
}
|
||||
splice.call(array, fromIndex, 1);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
return basePullAll;
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
define(['./_arrayMap', './_baseIndexOf'], function(arrayMap, baseIndexOf) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
|
||||
/** Built-in value references. */
|
||||
var splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pullAllBy` without support for iteratee
|
||||
* shorthands.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Array} values The values to remove.
|
||||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function basePullAllBy(array, values, iteratee) {
|
||||
var index = -1,
|
||||
length = values.length,
|
||||
seen = array;
|
||||
|
||||
if (iteratee) {
|
||||
seen = arrayMap(array, function(value) { return iteratee(value); });
|
||||
}
|
||||
while (++index < length) {
|
||||
var fromIndex = 0,
|
||||
value = values[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) {
|
||||
if (seen !== array) {
|
||||
splice.call(seen, fromIndex, 1);
|
||||
}
|
||||
splice.call(array, fromIndex, 1);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
return basePullAllBy;
|
||||
});
|
||||
@@ -1,9 +1,9 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.sortBy` which uses `comparer` to define
|
||||
* the sort order of `array` and replaces criteria objects with their
|
||||
* corresponding values.
|
||||
* The base implementation of `_.sortBy` which uses `comparer` to define the
|
||||
* sort order of `array` and replaces criteria objects with their corresponding
|
||||
* values.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to sort.
|
||||
|
||||
@@ -15,7 +15,7 @@ define(['./eq'], function(eq) {
|
||||
value = array[0],
|
||||
computed = iteratee ? iteratee(value) : value,
|
||||
seen = computed,
|
||||
resIndex = 0,
|
||||
resIndex = 1,
|
||||
result = [value];
|
||||
|
||||
while (++index < length) {
|
||||
@@ -24,7 +24,7 @@ define(['./eq'], function(eq) {
|
||||
|
||||
if (!eq(computed, seen)) {
|
||||
seen = computed;
|
||||
result[++resIndex] = value;
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
18
_baseUpdate.js
Normal file
18
_baseUpdate.js
Normal file
@@ -0,0 +1,18 @@
|
||||
define(['./_baseGet', './_baseSet'], function(baseGet, baseSet) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.update`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array|string} path The path of the property to update.
|
||||
* @param {Function} updater The function to produce the updated value.
|
||||
* @param {Function} [customizer] The function to customize path creation.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseUpdate(object, path, updater, customizer) {
|
||||
return baseSet(object, path, updater(baseGet(object, path)), customizer);
|
||||
}
|
||||
|
||||
return baseUpdate;
|
||||
});
|
||||
@@ -8,11 +8,8 @@ define(['./_Uint8Array'], function(Uint8Array) {
|
||||
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
||||
*/
|
||||
function cloneArrayBuffer(arrayBuffer) {
|
||||
var Ctor = arrayBuffer.constructor,
|
||||
result = new Ctor(arrayBuffer.byteLength),
|
||||
view = new Uint8Array(result);
|
||||
|
||||
view.set(new Uint8Array(arrayBuffer));
|
||||
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
||||
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ define([], function() {
|
||||
if (isDeep) {
|
||||
return buffer.slice();
|
||||
}
|
||||
var Ctor = buffer.constructor,
|
||||
result = new Ctor(buffer.length);
|
||||
|
||||
var result = new buffer.constructor(buffer.length);
|
||||
buffer.copy(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ define(['./_addMapEntry', './_arrayReduce', './_mapToArray'], function(addMapEnt
|
||||
* @returns {Object} Returns the cloned map.
|
||||
*/
|
||||
function cloneMap(map) {
|
||||
var Ctor = map.constructor;
|
||||
return arrayReduce(mapToArray(map), addMapEntry, new Ctor);
|
||||
return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);
|
||||
}
|
||||
|
||||
return cloneMap;
|
||||
|
||||
@@ -11,9 +11,7 @@ define([], function() {
|
||||
* @returns {Object} Returns the cloned regexp.
|
||||
*/
|
||||
function cloneRegExp(regexp) {
|
||||
var Ctor = regexp.constructor,
|
||||
result = new Ctor(regexp.source, reFlags.exec(regexp));
|
||||
|
||||
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
||||
result.lastIndex = regexp.lastIndex;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ define(['./_addSetEntry', './_arrayReduce', './_setToArray'], function(addSetEnt
|
||||
* @returns {Object} Returns the cloned set.
|
||||
*/
|
||||
function cloneSet(set) {
|
||||
var Ctor = set.constructor;
|
||||
return arrayReduce(setToArray(set), addSetEntry, new Ctor);
|
||||
return arrayReduce(setToArray(set), addSetEntry, new set.constructor);
|
||||
}
|
||||
|
||||
return cloneSet;
|
||||
|
||||
@@ -5,7 +5,7 @@ define(['./_Symbol'], function(Symbol) {
|
||||
|
||||
/** Used to convert symbols to primitives and strings. */
|
||||
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||||
symbolValueOf = Symbol ? symbolProto.valueOf : undefined;
|
||||
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
||||
|
||||
/**
|
||||
* Creates a clone of the `symbol` object.
|
||||
@@ -15,7 +15,7 @@ define(['./_Symbol'], function(Symbol) {
|
||||
* @returns {Object} Returns the cloned symbol object.
|
||||
*/
|
||||
function cloneSymbol(symbol) {
|
||||
return Symbol ? Object(symbolValueOf.call(symbol)) : {};
|
||||
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
||||
}
|
||||
|
||||
return cloneSymbol;
|
||||
|
||||
@@ -9,11 +9,8 @@ define(['./_cloneArrayBuffer'], function(cloneArrayBuffer) {
|
||||
* @returns {Object} Returns the cloned typed array.
|
||||
*/
|
||||
function cloneTypedArray(typedArray, isDeep) {
|
||||
var arrayBuffer = typedArray.buffer,
|
||||
buffer = isDeep ? cloneArrayBuffer(arrayBuffer) : arrayBuffer,
|
||||
Ctor = typedArray.constructor;
|
||||
|
||||
return new Ctor(buffer, typedArray.byteOffset, typedArray.length);
|
||||
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
||||
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
||||
}
|
||||
|
||||
return cloneTypedArray;
|
||||
|
||||
@@ -11,23 +11,28 @@ define([], function() {
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} partials The arguments to prepend to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
* @returns {Array} Returns the new array of composed arguments.
|
||||
*/
|
||||
function composeArgs(args, partials, holders) {
|
||||
var holdersLength = holders.length,
|
||||
argsIndex = -1,
|
||||
argsLength = nativeMax(args.length - holdersLength, 0),
|
||||
function composeArgs(args, partials, holders, isCurried) {
|
||||
var argsIndex = -1,
|
||||
argsLength = args.length,
|
||||
holdersLength = holders.length,
|
||||
leftIndex = -1,
|
||||
leftLength = partials.length,
|
||||
result = Array(leftLength + argsLength);
|
||||
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
||||
result = Array(leftLength + rangeLength),
|
||||
isUncurried = !isCurried;
|
||||
|
||||
while (++leftIndex < leftLength) {
|
||||
result[leftIndex] = partials[leftIndex];
|
||||
}
|
||||
while (++argsIndex < holdersLength) {
|
||||
result[holders[argsIndex]] = args[argsIndex];
|
||||
if (isUncurried || argsIndex < argsLength) {
|
||||
result[holders[argsIndex]] = args[argsIndex];
|
||||
}
|
||||
}
|
||||
while (argsLength--) {
|
||||
while (rangeLength--) {
|
||||
result[leftIndex++] = args[argsIndex++];
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -11,18 +11,21 @@ define([], function() {
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} partials The arguments to append to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
* @returns {Array} Returns the new array of composed arguments.
|
||||
*/
|
||||
function composeArgsRight(args, partials, holders) {
|
||||
var holdersIndex = -1,
|
||||
function composeArgsRight(args, partials, holders, isCurried) {
|
||||
var argsIndex = -1,
|
||||
argsLength = args.length,
|
||||
holdersIndex = -1,
|
||||
holdersLength = holders.length,
|
||||
argsIndex = -1,
|
||||
argsLength = nativeMax(args.length - holdersLength, 0),
|
||||
rightIndex = -1,
|
||||
rightLength = partials.length,
|
||||
result = Array(argsLength + rightLength);
|
||||
rangeLength = nativeMax(argsLength - holdersLength, 0),
|
||||
result = Array(rangeLength + rightLength),
|
||||
isUncurried = !isCurried;
|
||||
|
||||
while (++argsIndex < argsLength) {
|
||||
while (++argsIndex < rangeLength) {
|
||||
result[argsIndex] = args[argsIndex];
|
||||
}
|
||||
var offset = argsIndex;
|
||||
@@ -30,7 +33,9 @@ define([], function() {
|
||||
result[offset + rightIndex] = partials[rightIndex];
|
||||
}
|
||||
while (++holdersIndex < holdersLength) {
|
||||
result[offset + holders[holdersIndex]] = args[argsIndex++];
|
||||
if (isUncurried || argsIndex < argsLength) {
|
||||
result[offset + holders[holdersIndex]] = args[argsIndex++];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
24
_countHolders.js
Normal file
24
_countHolders.js
Normal file
@@ -0,0 +1,24 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Gets the number of `placeholder` occurrences in `array`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {*} placeholder The placeholder to search for.
|
||||
* @returns {number} Returns the placeholder count.
|
||||
*/
|
||||
function countHolders(array, placeholder) {
|
||||
var length = array.length,
|
||||
result = 0;
|
||||
|
||||
while (length--) {
|
||||
if (array[length] === placeholder) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
return countHolders;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_createRecurryWrapper', './_replaceHolders', './_root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, replaceHolders, root) {
|
||||
define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_createRecurryWrapper', './_getPlaceholder', './_replaceHolders', './_root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, getPlaceholder, replaceHolders, root) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -17,10 +17,9 @@ define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_create
|
||||
|
||||
function wrapper() {
|
||||
var length = arguments.length,
|
||||
index = length,
|
||||
args = Array(length),
|
||||
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
|
||||
placeholder = wrapper.placeholder;
|
||||
index = length,
|
||||
placeholder = getPlaceholder(wrapper);
|
||||
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
@@ -30,9 +29,13 @@ define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_create
|
||||
: replaceHolders(args, placeholder);
|
||||
|
||||
length -= holders.length;
|
||||
return length < arity
|
||||
? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length)
|
||||
: apply(fn, this, args);
|
||||
if (length < arity) {
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
|
||||
args, holders, undefined, undefined, arity - length);
|
||||
}
|
||||
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
||||
return apply(fn, this, args);
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@@ -3,18 +3,18 @@ define(['./_LodashWrapper', './_baseFlatten', './_getData', './_getFuncName', '.
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var CURRY_FLAG = 8,
|
||||
PARTIAL_FLAG = 32,
|
||||
ARY_FLAG = 128,
|
||||
REARG_FLAG = 256;
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var CURRY_FLAG = 8,
|
||||
PARTIAL_FLAG = 32,
|
||||
ARY_FLAG = 128,
|
||||
REARG_FLAG = 256;
|
||||
|
||||
/**
|
||||
* Creates a `_.flow` or `_.flowRight` function.
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_composeArgs', './_composeArgsRight', './_createCtorWrapper', './_createRecurryWrapper', './_reorder', './_replaceHolders', './_root'], function(composeArgs, composeArgsRight, createCtorWrapper, createRecurryWrapper, reorder, replaceHolders, root) {
|
||||
define(['./_composeArgs', './_composeArgsRight', './_countHolders', './_createCtorWrapper', './_createRecurryWrapper', './_getPlaceholder', './_reorder', './_replaceHolders', './_root'], function(composeArgs, composeArgsRight, countHolders, createCtorWrapper, createRecurryWrapper, getPlaceholder, reorder, replaceHolders, root) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -32,8 +32,7 @@ define(['./_composeArgs', './_composeArgsRight', './_createCtorWrapper', './_cre
|
||||
var isAry = bitmask & ARY_FLAG,
|
||||
isBind = bitmask & BIND_FLAG,
|
||||
isBindKey = bitmask & BIND_KEY_FLAG,
|
||||
isCurry = bitmask & CURRY_FLAG,
|
||||
isCurryRight = bitmask & CURRY_RIGHT_FLAG,
|
||||
isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
|
||||
isFlip = bitmask & FLIP_FLAG,
|
||||
Ctor = isBindKey ? undefined : createCtorWrapper(func);
|
||||
|
||||
@@ -45,33 +44,34 @@ define(['./_composeArgs', './_composeArgsRight', './_createCtorWrapper', './_cre
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
}
|
||||
if (isCurried) {
|
||||
var placeholder = getPlaceholder(wrapper),
|
||||
holdersCount = countHolders(args, placeholder);
|
||||
}
|
||||
if (partials) {
|
||||
args = composeArgs(args, partials, holders);
|
||||
args = composeArgs(args, partials, holders, isCurried);
|
||||
}
|
||||
if (partialsRight) {
|
||||
args = composeArgsRight(args, partialsRight, holdersRight);
|
||||
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
|
||||
}
|
||||
if (isCurry || isCurryRight) {
|
||||
var placeholder = wrapper.placeholder,
|
||||
argsHolders = replaceHolders(args, placeholder);
|
||||
|
||||
length -= argsHolders.length;
|
||||
if (length < arity) {
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, placeholder, thisArg, args,
|
||||
argsHolders, argPos, ary, arity - length
|
||||
);
|
||||
}
|
||||
length -= holdersCount;
|
||||
if (isCurried && length < arity) {
|
||||
var newHolders = replaceHolders(args, placeholder);
|
||||
return createRecurryWrapper(
|
||||
func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
|
||||
args, newHolders, argPos, ary, arity - length
|
||||
);
|
||||
}
|
||||
var thisBinding = isBind ? thisArg : this,
|
||||
fn = isBindKey ? thisBinding[func] : func;
|
||||
|
||||
length = args.length;
|
||||
if (argPos) {
|
||||
args = reorder(args, argPos);
|
||||
} else if (isFlip && args.length > 1) {
|
||||
} else if (isFlip && length > 1) {
|
||||
args.reverse();
|
||||
}
|
||||
if (isAry && ary < args.length) {
|
||||
if (isAry && ary < length) {
|
||||
args.length = ary;
|
||||
}
|
||||
if (this && this !== root && this instanceof wrapper) {
|
||||
|
||||
@@ -18,7 +18,7 @@ define(['./_copyArray', './_isLaziable', './_setData'], function(copyArray, isLa
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details.
|
||||
* @param {Function} wrapFunc The function to create the `func` wrapper.
|
||||
* @param {*} placeholder The placeholder to replace.
|
||||
* @param {*} placeholder The placeholder value.
|
||||
* @param {*} [thisArg] The `this` binding of `func`.
|
||||
* @param {Array} [partials] The arguments to prepend to those provided to the new function.
|
||||
* @param {Array} [holders] The `partials` placeholder indexes.
|
||||
@@ -30,7 +30,7 @@ define(['./_copyArray', './_isLaziable', './_setData'], function(copyArray, isLa
|
||||
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
||||
var isCurry = bitmask & CURRY_FLAG,
|
||||
newArgPos = argPos ? copyArray(argPos) : undefined,
|
||||
newsHolders = isCurry ? holders : undefined,
|
||||
newHolders = isCurry ? holders : undefined,
|
||||
newHoldersRight = isCurry ? undefined : holders,
|
||||
newPartials = isCurry ? partials : undefined,
|
||||
newPartialsRight = isCurry ? undefined : partials;
|
||||
@@ -42,7 +42,7 @@ define(['./_copyArray', './_isLaziable', './_setData'], function(copyArray, isLa
|
||||
bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
|
||||
}
|
||||
var newData = [
|
||||
func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight,
|
||||
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
||||
newHoldersRight, newArgPos, ary, arity
|
||||
];
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ define(['./_baseSetData', './_createBaseWrapper', './_createCurryWrapper', './_c
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
BIND_KEY_FLAG = 2,
|
||||
@@ -11,9 +14,6 @@ define(['./_baseSetData', './_createBaseWrapper', './_createCurryWrapper', './_c
|
||||
PARTIAL_FLAG = 32,
|
||||
PARTIAL_RIGHT_FLAG = 64;
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ define(['./_arraySome'], function(arraySome) {
|
||||
* @param {Array} array The array to compare.
|
||||
* @param {Array} other The other array to compare.
|
||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||
* @param {Function} [customizer] The function to customize comparisons.
|
||||
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
|
||||
* @param {Object} [stack] Tracks traversed `array` and `other` objects.
|
||||
* @param {Function} customizer The function to customize comparisons.
|
||||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.
|
||||
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
||||
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
||||
*/
|
||||
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_Symbol', './_Uint8Array', './_mapToArray', './_setToArray'], function(Symbol, Uint8Array, mapToArray, setToArray) {
|
||||
define(['./_Symbol', './_Uint8Array', './_equalArrays', './_mapToArray', './_setToArray'], function(Symbol, Uint8Array, equalArrays, mapToArray, setToArray) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -22,7 +22,7 @@ define(['./_Symbol', './_Uint8Array', './_mapToArray', './_setToArray'], functio
|
||||
|
||||
/** Used to convert symbols to primitives and strings. */
|
||||
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||||
symbolValueOf = Symbol ? symbolProto.valueOf : undefined;
|
||||
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
||||
|
||||
/**
|
||||
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
||||
@@ -36,11 +36,12 @@ define(['./_Symbol', './_Uint8Array', './_mapToArray', './_setToArray'], functio
|
||||
* @param {Object} other The other object to compare.
|
||||
* @param {string} tag The `toStringTag` of the objects to compare.
|
||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||
* @param {Function} [customizer] The function to customize comparisons.
|
||||
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
|
||||
* @param {Function} customizer The function to customize comparisons.
|
||||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.
|
||||
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
||||
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
||||
*/
|
||||
function equalByTag(object, other, tag, equalFunc, customizer, bitmask) {
|
||||
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
|
||||
switch (tag) {
|
||||
case arrayBufferTag:
|
||||
if ((object.byteLength != other.byteLength) ||
|
||||
@@ -75,12 +76,21 @@ define(['./_Symbol', './_Uint8Array', './_mapToArray', './_setToArray'], functio
|
||||
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
||||
convert || (convert = setToArray);
|
||||
|
||||
if (object.size != other.size && !isPartial) {
|
||||
return false;
|
||||
}
|
||||
// Assume cyclic values are equal.
|
||||
var stacked = stack.get(object);
|
||||
if (stacked) {
|
||||
return stacked == other;
|
||||
}
|
||||
// Recursively compare objects (susceptible to call stack limits).
|
||||
return (isPartial || object.size == other.size) &&
|
||||
equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG);
|
||||
return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other));
|
||||
|
||||
case symbolTag:
|
||||
return !!Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other));
|
||||
if (symbolValueOf) {
|
||||
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ define(['./_baseHas', './keys'], function(baseHas, keys) {
|
||||
* @param {Object} object The object to compare.
|
||||
* @param {Object} other The other object to compare.
|
||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||
* @param {Function} [customizer] The function to customize comparisons.
|
||||
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
|
||||
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
||||
* @param {Function} customizer The function to customize comparisons.
|
||||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details.
|
||||
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
||||
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
||||
*/
|
||||
function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
|
||||
|
||||
@@ -12,7 +12,7 @@ define(['./isNative'], function(isNative) {
|
||||
* @returns {*} Returns the function if it's native, else `undefined`.
|
||||
*/
|
||||
function getNative(object, key) {
|
||||
var value = object == null ? undefined : object[key];
|
||||
var value = object[key];
|
||||
return isNative(value) ? value : undefined;
|
||||
}
|
||||
|
||||
|
||||
16
_getPlaceholder.js
Normal file
16
_getPlaceholder.js
Normal file
@@ -0,0 +1,16 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Gets the argument placeholder value for `func`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to inspect.
|
||||
* @returns {*} Returns the placeholder value.
|
||||
*/
|
||||
function getPlaceholder(func) {
|
||||
var object = func;
|
||||
return object.placeholder;
|
||||
}
|
||||
|
||||
return getPlaceholder;
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
define(['./_baseCreate', './isFunction', './_isPrototype'], function(baseCreate, isFunction, isPrototype) {
|
||||
define(['./_baseCreate', './_isPrototype'], function(baseCreate, isPrototype) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
/** Built-in value references. */
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
|
||||
/**
|
||||
* Initializes an object clone.
|
||||
@@ -11,11 +11,9 @@ define(['./_baseCreate', './isFunction', './_isPrototype'], function(baseCreate,
|
||||
* @returns {Object} Returns the initialized clone.
|
||||
*/
|
||||
function initCloneObject(object) {
|
||||
if (isPrototype(object)) {
|
||||
return {};
|
||||
}
|
||||
var Ctor = object.constructor;
|
||||
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
|
||||
return (typeof object.constructor == 'function' && !isPrototype(object))
|
||||
? baseCreate(getPrototypeOf(object))
|
||||
: {};
|
||||
}
|
||||
|
||||
return initCloneObject;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
define(['./_composeArgs', './_composeArgsRight', './_copyArray', './_replaceHolders'], function(composeArgs, composeArgsRight, copyArray, replaceHolders) {
|
||||
|
||||
/** Used as the internal argument placeholder. */
|
||||
var PLACEHOLDER = '__lodash_placeholder__';
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
BIND_KEY_FLAG = 2,
|
||||
@@ -8,9 +11,6 @@ define(['./_composeArgs', './_composeArgsRight', './_copyArray', './_replaceHold
|
||||
ARY_FLAG = 128,
|
||||
REARG_FLAG = 256;
|
||||
|
||||
/** Used as the internal argument placeholder. */
|
||||
var PLACEHOLDER = '__lodash_placeholder__';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMin = Math.min;
|
||||
|
||||
@@ -36,9 +36,9 @@ define(['./_composeArgs', './_composeArgsRight', './_copyArray', './_replaceHold
|
||||
isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
|
||||
|
||||
var isCombo =
|
||||
(srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) ||
|
||||
(srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
|
||||
(srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
|
||||
((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
|
||||
((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
|
||||
((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
|
||||
|
||||
// Exit early if metadata can't be merged.
|
||||
if (!(isCommon || isCombo)) {
|
||||
@@ -48,7 +48,7 @@ define(['./_composeArgs', './_composeArgsRight', './_copyArray', './_replaceHold
|
||||
if (srcBitmask & BIND_FLAG) {
|
||||
data[2] = source[2];
|
||||
// Set when currying a bound function.
|
||||
newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
|
||||
newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
|
||||
}
|
||||
// Compose partial arguments.
|
||||
var value = source[3];
|
||||
|
||||
@@ -17,8 +17,7 @@ define(['./_baseMerge', './isObject'], function(baseMerge, isObject) {
|
||||
*/
|
||||
function mergeDefaults(objValue, srcValue, key, object, source, stack) {
|
||||
if (isObject(objValue) && isObject(srcValue)) {
|
||||
stack.set(srcValue, objValue);
|
||||
baseMerge(objValue, srcValue, undefined, mergeDefaults, stack);
|
||||
baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue));
|
||||
}
|
||||
return objValue;
|
||||
}
|
||||
|
||||
@@ -15,13 +15,14 @@ define([], function() {
|
||||
function replaceHolders(array, placeholder) {
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
resIndex = -1,
|
||||
resIndex = 0,
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
if (array[index] === placeholder) {
|
||||
var value = array[index];
|
||||
if (value === placeholder || value === PLACEHOLDER) {
|
||||
array[index] = PLACEHOLDER;
|
||||
result[++resIndex] = index;
|
||||
result[resIndex++] = index;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
3
array.js
3
array.js
@@ -1,4 +1,4 @@
|
||||
define(['./chunk', './compact', './concat', './difference', './differenceBy', './differenceWith', './drop', './dropRight', './dropRightWhile', './dropWhile', './fill', './findIndex', './findLastIndex', './flatten', './flattenDeep', './flattenDepth', './fromPairs', './head', './indexOf', './initial', './intersection', './intersectionBy', './intersectionWith', './join', './last', './lastIndexOf', './pull', './pullAll', './pullAllBy', './pullAt', './remove', './reverse', './slice', './sortedIndex', './sortedIndexBy', './sortedIndexOf', './sortedLastIndex', './sortedLastIndexBy', './sortedLastIndexOf', './sortedUniq', './sortedUniqBy', './tail', './take', './takeRight', './takeRightWhile', './takeWhile', './union', './unionBy', './unionWith', './uniq', './uniqBy', './uniqWith', './unzip', './unzipWith', './without', './xor', './xorBy', './xorWith', './zip', './zipObject', './zipObjectDeep', './zipWith'], function(chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, flatten, flattenDeep, flattenDepth, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, pull, pullAll, pullAllBy, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith) {
|
||||
define(['./chunk', './compact', './concat', './difference', './differenceBy', './differenceWith', './drop', './dropRight', './dropRightWhile', './dropWhile', './fill', './findIndex', './findLastIndex', './flatten', './flattenDeep', './flattenDepth', './fromPairs', './head', './indexOf', './initial', './intersection', './intersectionBy', './intersectionWith', './join', './last', './lastIndexOf', './pull', './pullAll', './pullAllBy', './pullAllWith', './pullAt', './remove', './reverse', './slice', './sortedIndex', './sortedIndexBy', './sortedIndexOf', './sortedLastIndex', './sortedLastIndexBy', './sortedLastIndexOf', './sortedUniq', './sortedUniqBy', './tail', './take', './takeRight', './takeRightWhile', './takeWhile', './union', './unionBy', './unionWith', './uniq', './uniqBy', './uniqWith', './unzip', './unzipWith', './without', './xor', './xorBy', './xorWith', './zip', './zipObject', './zipObjectDeep', './zipWith'], function(chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, flatten, flattenDeep, flattenDepth, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith) {
|
||||
return {
|
||||
'chunk': chunk,
|
||||
'compact': compact,
|
||||
@@ -29,6 +29,7 @@ define(['./chunk', './compact', './concat', './difference', './differenceBy', '.
|
||||
'pull': pull,
|
||||
'pullAll': pullAll,
|
||||
'pullAllBy': pullAllBy,
|
||||
'pullAllWith': pullAllWith,
|
||||
'pullAt': pullAt,
|
||||
'remove': remove,
|
||||
'reverse': reverse,
|
||||
|
||||
21
assign.js
21
assign.js
@@ -1,4 +1,13 @@
|
||||
define(['./_copyObject', './_createAssigner', './keys'], function(copyObject, createAssigner, keys) {
|
||||
define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike', './_isPrototype', './keys'], function(assignValue, copyObject, createAssigner, isArrayLike, isPrototype, keys) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
||||
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf');
|
||||
|
||||
/**
|
||||
* Assigns own enumerable properties of source objects to the destination
|
||||
@@ -31,7 +40,15 @@ define(['./_copyObject', './_createAssigner', './keys'], function(copyObject, cr
|
||||
* // => { 'a': 1, 'c': 3, 'e': 5 }
|
||||
*/
|
||||
var assign = createAssigner(function(object, source) {
|
||||
copyObject(source, keys(source), object);
|
||||
if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
|
||||
copyObject(source, keys(source), object);
|
||||
return;
|
||||
}
|
||||
for (var key in source) {
|
||||
if (hasOwnProperty.call(source, key)) {
|
||||
assignValue(object, key, source[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return assign;
|
||||
|
||||
13
assignIn.js
13
assignIn.js
@@ -1,4 +1,7 @@
|
||||
define(['./_copyObject', './_createAssigner', './keysIn'], function(copyObject, createAssigner, keysIn) {
|
||||
define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike', './_isPrototype', './keysIn'], function(assignValue, copyObject, createAssigner, isArrayLike, isPrototype, keysIn) {
|
||||
|
||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
||||
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf');
|
||||
|
||||
/**
|
||||
* This method is like `_.assign` except that it iterates over own and
|
||||
@@ -30,7 +33,13 @@ define(['./_copyObject', './_createAssigner', './keysIn'], function(copyObject,
|
||||
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
|
||||
*/
|
||||
var assignIn = createAssigner(function(object, source) {
|
||||
copyObject(source, keysIn(source), object);
|
||||
if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
|
||||
copyObject(source, keysIn(source), object);
|
||||
return;
|
||||
}
|
||||
for (var key in source) {
|
||||
assignValue(object, key, source[key]);
|
||||
}
|
||||
});
|
||||
|
||||
return assignIn;
|
||||
|
||||
6
bind.js
6
bind.js
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
@@ -42,9 +42,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
var bind = rest(function(func, thisArg, partials) {
|
||||
var bitmask = BIND_FLAG;
|
||||
if (partials.length) {
|
||||
var placeholder = bind.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(bind));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(func, bitmask, thisArg, partials, holders);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
@@ -52,9 +52,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
var bindKey = rest(function(object, key, partials) {
|
||||
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
|
||||
if (partials.length) {
|
||||
var placeholder = bindKey.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(bindKey));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(key, bitmask, object, partials, holders);
|
||||
|
||||
4
chunk.js
4
chunk.js
@@ -31,11 +31,11 @@ define(['./_baseSlice', './toInteger'], function(baseSlice, toInteger) {
|
||||
return [];
|
||||
}
|
||||
var index = 0,
|
||||
resIndex = -1,
|
||||
resIndex = 0,
|
||||
result = Array(nativeCeil(length / size));
|
||||
|
||||
while (index < length) {
|
||||
result[++resIndex] = baseSlice(array, index, (index += size));
|
||||
result[resIndex++] = baseSlice(array, index, (index += size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@ define([], function() {
|
||||
function compact(array) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
resIndex = -1,
|
||||
resIndex = 0,
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (value) {
|
||||
result[++resIndex] = value;
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -3,7 +3,8 @@ define(['./_baseDifference', './_baseFlatten', './isArrayLikeObject', './rest'],
|
||||
/**
|
||||
* Creates an array of unique `array` values not included in the other
|
||||
* given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
* for equality comparisons. The order of result values is determined by the
|
||||
* order they occur in the first array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -6,7 +6,8 @@ define(['./_baseDifference', './_baseFlatten', './_baseIteratee', './isArrayLike
|
||||
/**
|
||||
* This method is like `_.difference` except that it accepts `iteratee` which
|
||||
* is invoked for each element of `array` and `values` to generate the criterion
|
||||
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
|
||||
* by which they're compared. Result values are chosen from the first array.
|
||||
* The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -5,8 +5,9 @@ define(['./_baseDifference', './_baseFlatten', './isArrayLikeObject', './last',
|
||||
|
||||
/**
|
||||
* This method is like `_.difference` except that it accepts `comparator`
|
||||
* which is invoked to compare elements of `array` to `values`. The comparator
|
||||
* is invoked with two arguments: (arrVal, othVal).
|
||||
* which is invoked to compare elements of `array` to `values`. Result values
|
||||
* are chosen from the first array. The comparator is invoked with two arguments:
|
||||
* (arrVal, othVal).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -3,13 +3,14 @@ define(['./_arrayMap', './_baseCastArrayLikeObject', './_baseIntersection', './r
|
||||
/**
|
||||
* Creates an array of unique values that are included in all given arrays
|
||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
* for equality comparisons. The order of result values is determined by the
|
||||
* order they occur in the first array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @returns {Array} Returns the new array of shared values.
|
||||
* @returns {Array} Returns the new array of intersecting values.
|
||||
* @example
|
||||
*
|
||||
* _.intersection([2, 1], [4, 2], [1, 2]);
|
||||
|
||||
@@ -6,14 +6,15 @@ define(['./_arrayMap', './_baseCastArrayLikeObject', './_baseIntersection', './_
|
||||
/**
|
||||
* This method is like `_.intersection` except that it accepts `iteratee`
|
||||
* which is invoked for each element of each `arrays` to generate the criterion
|
||||
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
|
||||
* by which they're compared. Result values are chosen from the first array.
|
||||
* The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new array of shared values.
|
||||
* @returns {Array} Returns the new array of intersecting values.
|
||||
* @example
|
||||
*
|
||||
* _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
|
||||
|
||||
@@ -5,15 +5,16 @@ define(['./_arrayMap', './_baseCastArrayLikeObject', './_baseIntersection', './l
|
||||
|
||||
/**
|
||||
* This method is like `_.intersection` except that it accepts `comparator`
|
||||
* which is invoked to compare elements of `arrays`. The comparator is invoked
|
||||
* with two arguments: (arrVal, othVal).
|
||||
* which is invoked to compare elements of `arrays`. Result values are chosen
|
||||
* from the first array. The comparator is invoked with two arguments:
|
||||
* (arrVal, othVal).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new array of shared values.
|
||||
* @returns {Array} Returns the new array of intersecting values.
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
||||
|
||||
@@ -25,8 +25,7 @@ define(['./_getLength', './isFunction', './isLength'], function(getLength, isFun
|
||||
* // => false
|
||||
*/
|
||||
function isArrayLike(value) {
|
||||
return value != null &&
|
||||
!(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));
|
||||
return value != null && isLength(getLength(value)) && !isFunction(value);
|
||||
}
|
||||
|
||||
return isArrayLike;
|
||||
|
||||
@@ -7,14 +7,14 @@ define(['./isArguments', './isArray', './isArrayLike', './isFunction', './isStri
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Checks if `value` is empty. A value is considered empty unless it's an
|
||||
* `arguments` object, array, string, or jQuery-like collection with a length
|
||||
* greater than `0` or an object with own enumerable properties.
|
||||
* Checks if `value` is an empty collection or object. A value is considered
|
||||
* empty if it's an `arguments` object, array, string, or jQuery-like collection
|
||||
* with a length of `0` or has no own enumerable properties.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {Array|Object|string} value The value to inspect.
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
||||
* @example
|
||||
*
|
||||
|
||||
@@ -33,9 +33,8 @@ define(['./isObjectLike'], function(isObjectLike) {
|
||||
if (!isObjectLike(value)) {
|
||||
return false;
|
||||
}
|
||||
var Ctor = value.constructor;
|
||||
return (objectToString.call(value) == errorTag) ||
|
||||
(typeof Ctor == 'function' && objectToString.call(Ctor.prototype) == errorTag);
|
||||
(typeof value.message == 'string' && typeof value.name == 'string');
|
||||
}
|
||||
|
||||
return isError;
|
||||
|
||||
@@ -31,8 +31,8 @@ define(['./isObject'], function(isObject) {
|
||||
*/
|
||||
function isFunction(value) {
|
||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||
// in Safari 8 which returns 'object' for typed array constructors, and
|
||||
// PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
||||
// in Safari 8 which returns 'object' for typed array and weak map constructors,
|
||||
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||
return tag == funcTag || tag == genTag;
|
||||
}
|
||||
|
||||
@@ -53,10 +53,7 @@ define(['./_isHostObject', './isObjectLike'], function(isHostObject, isObjectLik
|
||||
objectToString.call(value) != objectTag || isHostObject(value)) {
|
||||
return false;
|
||||
}
|
||||
var proto = objectProto;
|
||||
if (typeof value.constructor == 'function') {
|
||||
proto = getPrototypeOf(value);
|
||||
}
|
||||
var proto = getPrototypeOf(value);
|
||||
if (proto === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ define(['./_baseForOwn', './_baseIteratee'], function(baseForOwn, baseIteratee)
|
||||
/**
|
||||
* The opposite of `_.mapValues`; this method creates an object with the
|
||||
* same values as `object` and keys generated by running each own enumerable
|
||||
* property of `object` through `iteratee`.
|
||||
* property of `object` through `iteratee`. The iteratee is invoked with
|
||||
* three arguments: (value, key, object).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -3,7 +3,7 @@ define(['./_baseForOwn', './_baseIteratee'], function(baseForOwn, baseIteratee)
|
||||
/**
|
||||
* Creates an object with the same keys as `object` and values generated by
|
||||
* running each own enumerable property of `object` through `iteratee`. The
|
||||
* iteratee function is invoked with three arguments: (value, key, object).
|
||||
* iteratee is invoked with three arguments: (value, key, object).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
13
merge.js
13
merge.js
@@ -1,12 +1,13 @@
|
||||
define(['./_baseMerge', './_createAssigner'], function(baseMerge, createAssigner) {
|
||||
|
||||
/**
|
||||
* Recursively merges own and inherited enumerable properties of source objects
|
||||
* into the destination object. Source properties that resolve to `undefined`
|
||||
* are skipped if a destination value exists. Array and plain object properties
|
||||
* are merged recursively. Other objects and value types are overridden by
|
||||
* assignment. Source objects are applied from left to right. Subsequent
|
||||
* sources overwrite property assignments of previous sources.
|
||||
* This method is like `_.assign` except that it recursively merges own and
|
||||
* inherited enumerable properties of source objects into the destination
|
||||
* object. Source properties that resolve to `undefined` are skipped if a
|
||||
* destination value exists. Array and plain object properties are merged
|
||||
* recursively.Other objects and value types are overridden by assignment.
|
||||
* Source objects are applied from left to right. Subsequent sources
|
||||
* overwrite property assignments of previous sources.
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./assign', './assignIn', './assignInWith', './assignWith', './create', './defaults', './defaultsDeep', './extend', './extendWith', './findKey', './findLastKey', './forIn', './forInRight', './forOwn', './forOwnRight', './functions', './functionsIn', './get', './has', './hasIn', './invert', './invertBy', './invoke', './keys', './keysIn', './mapKeys', './mapValues', './merge', './mergeWith', './omit', './omitBy', './pick', './pickBy', './result', './set', './setWith', './toPairs', './toPairsIn', './transform', './unset', './values', './valuesIn'], function(assign, assignIn, assignInWith, assignWith, create, defaults, defaultsDeep, extend, extendWith, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, functionsIn, get, has, hasIn, invert, invertBy, invoke, keys, keysIn, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, result, set, setWith, toPairs, toPairsIn, transform, unset, values, valuesIn) {
|
||||
define(['./assign', './assignIn', './assignInWith', './assignWith', './create', './defaults', './defaultsDeep', './extend', './extendWith', './findKey', './findLastKey', './forIn', './forInRight', './forOwn', './forOwnRight', './functions', './functionsIn', './get', './has', './hasIn', './invert', './invertBy', './invoke', './keys', './keysIn', './mapKeys', './mapValues', './merge', './mergeWith', './omit', './omitBy', './pick', './pickBy', './result', './set', './setWith', './toPairs', './toPairsIn', './transform', './unset', './update', './updateWith', './values', './valuesIn'], function(assign, assignIn, assignInWith, assignWith, create, defaults, defaultsDeep, extend, extendWith, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, functionsIn, get, has, hasIn, invert, invertBy, invoke, keys, keysIn, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, result, set, setWith, toPairs, toPairsIn, transform, unset, update, updateWith, values, valuesIn) {
|
||||
return {
|
||||
'assign': assign,
|
||||
'assignIn': assignIn,
|
||||
@@ -40,6 +40,8 @@ define(['./assign', './assignIn', './assignInWith', './assignWith', './create',
|
||||
'toPairsIn': toPairsIn,
|
||||
'transform': transform,
|
||||
'unset': unset,
|
||||
'update': update,
|
||||
'updateWith': updateWith,
|
||||
'values': values,
|
||||
'valuesIn': valuesIn
|
||||
};
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy) {
|
||||
|
||||
/**
|
||||
* The opposite of `_.pickBy`; this method creates an object composed of the
|
||||
* own and inherited enumerable properties of `object` that `predicate`
|
||||
* doesn't return truthy for.
|
||||
* The opposite of `_.pickBy`; this method creates an object composed of
|
||||
* the own and inherited enumerable properties of `object` that `predicate`
|
||||
* doesn't return truthy for. The predicate is invoked with two arguments:
|
||||
* (value, key).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -19,7 +20,7 @@ define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy)
|
||||
* // => { 'b': '2' }
|
||||
*/
|
||||
function omitBy(object, predicate) {
|
||||
predicate = baseIteratee(predicate, 2);
|
||||
predicate = baseIteratee(predicate);
|
||||
return basePickBy(object, function(value, key) {
|
||||
return !predicate(value, key);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash-amd",
|
||||
"version": "4.5.0",
|
||||
"version": "4.6.0",
|
||||
"description": "Lodash exported as AMD modules.",
|
||||
"homepage": "https://lodash.com/custom-builds",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -39,9 +39,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
* // => 'hi fred'
|
||||
*/
|
||||
var partial = rest(function(func, partials) {
|
||||
var placeholder = partial.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(partial));
|
||||
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapper, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -38,9 +38,7 @@ define(['./_createWrapper', './_replaceHolders', './rest'], function(createWrapp
|
||||
* // => 'hello fred'
|
||||
*/
|
||||
var partialRight = rest(function(func, partials) {
|
||||
var placeholder = partialRight.placeholder,
|
||||
holders = replaceHolders(partials, placeholder);
|
||||
|
||||
var holders = replaceHolders(partials, getPlaceholder(partialRight));
|
||||
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ define(['./_baseIteratee', './_basePickBy'], function(baseIteratee, basePickBy)
|
||||
* // => { 'a': 1, 'c': 3 }
|
||||
*/
|
||||
function pickBy(object, predicate) {
|
||||
return object == null ? {} : basePickBy(object, baseIteratee(predicate, 2));
|
||||
return object == null ? {} : basePickBy(object, baseIteratee(predicate));
|
||||
}
|
||||
|
||||
return pickBy;
|
||||
|
||||
3
pull.js
3
pull.js
@@ -5,7 +5,8 @@ define(['./pullAll', './rest'], function(pullAll, rest) {
|
||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* for equality comparisons.
|
||||
*
|
||||
* **Note:** Unlike `_.without`, this method mutates `array`.
|
||||
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
|
||||
* to remove elements from an array by predicate.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
define(['./_baseIteratee', './_basePullAllBy'], function(baseIteratee, basePullAllBy) {
|
||||
define(['./_baseIteratee', './_basePullAll'], function(baseIteratee, basePullAll) {
|
||||
|
||||
/**
|
||||
* This method is like `_.pullAll` except that it accepts `iteratee` which is
|
||||
* invoked for each element of `array` and `values` to generate the criterion
|
||||
* by which uniqueness is computed. The iteratee is invoked with one argument: (value).
|
||||
* by which they're compared. The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
|
||||
*
|
||||
@@ -24,7 +24,7 @@ define(['./_baseIteratee', './_basePullAllBy'], function(baseIteratee, basePullA
|
||||
*/
|
||||
function pullAllBy(array, values, iteratee) {
|
||||
return (array && array.length && values && values.length)
|
||||
? basePullAllBy(array, values, baseIteratee(iteratee))
|
||||
? basePullAll(array, values, baseIteratee(iteratee))
|
||||
: array;
|
||||
}
|
||||
|
||||
|
||||
35
pullAllWith.js
Normal file
35
pullAllWith.js
Normal file
@@ -0,0 +1,35 @@
|
||||
define(['./_basePullAll'], function(basePullAll) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* This method is like `_.pullAll` except that it accepts `comparator` which
|
||||
* is invoked to compare elements of `array` to `values`. The comparator is
|
||||
* invoked with two arguments: (arrVal, othVal).
|
||||
*
|
||||
* **Note:** Unlike `_.differenceWith`, this method mutates `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Array} values The values to remove.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @example
|
||||
*
|
||||
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
||||
*
|
||||
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
|
||||
* console.log(array);
|
||||
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
|
||||
*/
|
||||
function pullAllWith(array, values, comparator) {
|
||||
return (array && array.length && values && values.length)
|
||||
? basePullAll(array, values, undefined, comparator)
|
||||
: array;
|
||||
}
|
||||
|
||||
return pullAllWith;
|
||||
});
|
||||
@@ -2,10 +2,11 @@ define(['./_baseIteratee', './_basePullAt'], function(baseIteratee, basePullAt)
|
||||
|
||||
/**
|
||||
* Removes all elements from `array` that `predicate` returns truthy for
|
||||
* and returns an array of the removed elements. The predicate is invoked with
|
||||
* three arguments: (value, index, array).
|
||||
* and returns an array of the removed elements. The predicate is invoked
|
||||
* with three arguments: (value, index, array).
|
||||
*
|
||||
* **Note:** Unlike `_.filter`, this method mutates `array`.
|
||||
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
|
||||
* to pull elements from an array by value.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -21,8 +21,10 @@ define(['./_baseSet'], function(baseSet) {
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object);
|
||||
* // => { '0': { '1': { '2': 3 }, 'length': 2 } }
|
||||
* var object = {};
|
||||
*
|
||||
* _.setWith(object, '[0][1]', 'a', Object);
|
||||
* // => { '0': { '1': 'a' } }
|
||||
*/
|
||||
function setWith(object, path, value, customizer) {
|
||||
customizer = typeof customizer == 'function' ? customizer : undefined;
|
||||
|
||||
4
times.js
4
times.js
@@ -10,8 +10,8 @@ define(['./_baseCastFunction', './_baseTimes', './toInteger'], function(baseCast
|
||||
var nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* Invokes the iteratee function `n` times, returning an array of the results
|
||||
* of each invocation. The iteratee is invoked with one argument; (index).
|
||||
* Invokes the iteratee `n` times, returning an array of the results of
|
||||
* each invocation. The iteratee is invoked with one argument; (index).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
define(['./toString'], function(toString) {
|
||||
|
||||
/**
|
||||
* Converts `string`, as a whole, to lower case.
|
||||
* Converts `string`, as a whole, to lower case just like
|
||||
* [String#toLowerCase](https://mdn.io/toLowerCase).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -8,7 +8,7 @@ define(['./_Symbol', './isSymbol'], function(Symbol, isSymbol) {
|
||||
|
||||
/** Used to convert symbols to primitives and strings. */
|
||||
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||||
symbolToString = Symbol ? symbolProto.toString : undefined;
|
||||
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
||||
|
||||
/**
|
||||
* Converts `value` to a string if it's not one. An empty string is returned
|
||||
@@ -39,7 +39,7 @@ define(['./_Symbol', './isSymbol'], function(Symbol, isSymbol) {
|
||||
return '';
|
||||
}
|
||||
if (isSymbol(value)) {
|
||||
return Symbol ? symbolToString.call(value) : '';
|
||||
return symbolToString ? symbolToString.call(value) : '';
|
||||
}
|
||||
var result = (value + '');
|
||||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
define(['./toString'], function(toString) {
|
||||
|
||||
/**
|
||||
* Converts `string`, as a whole, to upper case.
|
||||
* Converts `string`, as a whole, to upper case just like
|
||||
* [String#toUpperCase](https://mdn.io/toUpperCase).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
define(['./_arrayEach', './_baseCreate', './_baseForOwn', './_baseIteratee', './isArray', './isFunction', './isObject', './isTypedArray'], function(arrayEach, baseCreate, baseForOwn, baseIteratee, isArray, isFunction, isObject, isTypedArray) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
/** Built-in value references. */
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
|
||||
/**
|
||||
* An alternative to `_.reduce`; this method transforms `object` to a new
|
||||
@@ -41,7 +41,7 @@ define(['./_arrayEach', './_baseCreate', './_baseForOwn', './_baseIteratee', './
|
||||
if (isArr) {
|
||||
accumulator = isArray(object) ? new Ctor : [];
|
||||
} else {
|
||||
accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
|
||||
accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {};
|
||||
}
|
||||
} else {
|
||||
accumulator = {};
|
||||
|
||||
34
update.js
Normal file
34
update.js
Normal file
@@ -0,0 +1,34 @@
|
||||
define(['./_baseCastFunction', './_baseUpdate'], function(baseCastFunction, baseUpdate) {
|
||||
|
||||
/**
|
||||
* This method is like `_.set` except that accepts `updater` to produce the
|
||||
* value to set. Use `_.updateWith` to customize `path` creation. The `updater`
|
||||
* is invoked with one argument: (value).
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The object to modify.
|
||||
* @param {Array|string} path The path of the property to set.
|
||||
* @param {Function} updater The function to produce the updated value.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
||||
*
|
||||
* _.update(object, 'a[0].b.c', function(n) { return n * n; });
|
||||
* console.log(object.a[0].b.c);
|
||||
* // => 9
|
||||
*
|
||||
* _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
|
||||
* console.log(object.x[0].y.z);
|
||||
* // => 0
|
||||
*/
|
||||
function update(object, path, updater) {
|
||||
return object == null ? object : baseUpdate(object, path, baseCastFunction(updater));
|
||||
}
|
||||
|
||||
return update;
|
||||
});
|
||||
35
updateWith.js
Normal file
35
updateWith.js
Normal file
@@ -0,0 +1,35 @@
|
||||
define(['./_baseCastFunction', './_baseUpdate'], function(baseCastFunction, baseUpdate) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* This method is like `_.update` except that it accepts `customizer` which is
|
||||
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
|
||||
* path creation is handled by the method instead. The `customizer` is invoked
|
||||
* with three arguments: (nsValue, key, nsObject).
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The object to modify.
|
||||
* @param {Array|string} path The path of the property to set.
|
||||
* @param {Function} updater The function to produce the updated value.
|
||||
* @param {Function} [customizer] The function to customize assigned values.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* var object = {};
|
||||
*
|
||||
* _.updateWith(object, '[0][1]', _.constant('a'), Object);
|
||||
* // => { '0': { '1': 'a' } }
|
||||
*/
|
||||
function updateWith(object, path, updater, customizer) {
|
||||
customizer = typeof customizer == 'function' ? customizer : undefined;
|
||||
return object == null ? object : baseUpdate(object, path, baseCastFunction(updater), customizer);
|
||||
}
|
||||
|
||||
return updateWith;
|
||||
});
|
||||
@@ -48,46 +48,48 @@ define(['./_LazyWrapper', './_LodashWrapper', './_baseLodash', './isArray', './i
|
||||
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
|
||||
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
|
||||
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
|
||||
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
|
||||
* `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`,
|
||||
* `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flattenDepth`,
|
||||
* `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, `functionsIn`,
|
||||
* `groupBy`, `initial`, `intersection`, `intersectionBy`, `intersectionWith`,
|
||||
* `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`,
|
||||
* `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`,
|
||||
* `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, `nthArg`,
|
||||
* `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, `overEvery`,
|
||||
* `overSome`, `partial`, `partialRight`, `partition`, `pick`, `pickBy`, `plant`,
|
||||
* `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`,
|
||||
* `range`, `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`,
|
||||
* `sampleSize`, `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`,
|
||||
* `splice`, `spread`, `tail`, `take`, `takeRight`, `takeRightWhile`,
|
||||
* `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, `toPairs`, `toPairsIn`,
|
||||
* `toPath`, `toPlainObject`, `transform`, `unary`, `union`, `unionBy`,
|
||||
* `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, `unshift`, `unzip`,
|
||||
* `unzipWith`, `values`, `valuesIn`, `without`, `wrap`, `xor`, `xorBy`,
|
||||
* `xorWith`, `zip`, `zipObject`, `zipObjectDeep`, and `zipWith`
|
||||
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
|
||||
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
|
||||
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
|
||||
* `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`,
|
||||
* `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`,
|
||||
* `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`,
|
||||
* `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`,
|
||||
* `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`,
|
||||
* `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`,
|
||||
* `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`,
|
||||
* `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`,
|
||||
* `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`,
|
||||
* `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`,
|
||||
* `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`,
|
||||
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
|
||||
* `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`,
|
||||
* `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`,
|
||||
* `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `values`,
|
||||
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`,
|
||||
* `zipObjectDeep`, and `zipWith`
|
||||
*
|
||||
* The wrapper methods that are **not** chainable by default are:
|
||||
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
|
||||
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`,
|
||||
* `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
|
||||
* `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, `forIn`,
|
||||
* `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`,
|
||||
* `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`,
|
||||
* `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
|
||||
* `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
|
||||
* `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`,
|
||||
* `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
|
||||
* `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
|
||||
* `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
|
||||
* `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
|
||||
* `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`,
|
||||
* `now`, `pad`, `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`,
|
||||
* `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`,
|
||||
* `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`,
|
||||
* `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`,
|
||||
* `sum`, `sumBy`, `template`, `times`, `toLower`, `toInteger`, `toLength`,
|
||||
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `each`, `eachRight`,
|
||||
* `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
|
||||
* `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`,
|
||||
* `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
|
||||
* `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`,
|
||||
* `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`,
|
||||
* `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`,
|
||||
* `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`,
|
||||
* `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`,
|
||||
* `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`,
|
||||
* `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`,
|
||||
* `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`,
|
||||
* `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`,
|
||||
* `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`,
|
||||
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
|
||||
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
|
||||
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
|
||||
* `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`,
|
||||
* `template`, `times`, `toInteger`, `toJSON`, `toLength`, `toLower`,
|
||||
* `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,
|
||||
* `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,
|
||||
* `value`, and `words`
|
||||
@@ -132,6 +134,7 @@ define(['./_LazyWrapper', './_LodashWrapper', './_baseLodash', './isArray', './i
|
||||
|
||||
// Ensure wrappers are instances of `baseLodash`.
|
||||
lodash.prototype = baseLodash.prototype;
|
||||
lodash.prototype.constructor = lodash;
|
||||
|
||||
return lodash;
|
||||
});
|
||||
|
||||
3
xor.js
3
xor.js
@@ -2,7 +2,8 @@ define(['./_arrayFilter', './_baseXor', './isArrayLikeObject', './rest'], functi
|
||||
|
||||
/**
|
||||
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
|
||||
* of the given arrays.
|
||||
* of the given arrays. The order of result values is determined by the order
|
||||
* they occur in the arrays.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
2
xorBy.js
2
xorBy.js
@@ -6,7 +6,7 @@ define(['./_arrayFilter', './_baseIteratee', './_baseXor', './isArrayLikeObject'
|
||||
/**
|
||||
* This method is like `_.xor` except that it accepts `iteratee` which is
|
||||
* invoked for each element of each `arrays` to generate the criterion by which
|
||||
* uniqueness is computed. The iteratee is invoked with one argument: (value).
|
||||
* by which they're compared. The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
Reference in New Issue
Block a user