mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Add more arity hints.
This commit is contained in:
28
lodash.js
28
lodash.js
@@ -4494,7 +4494,7 @@
|
|||||||
var func = isArray(collection) ? arrayAggregator : baseAggregator,
|
var func = isArray(collection) ? arrayAggregator : baseAggregator,
|
||||||
accumulator = initializer ? initializer() : {};
|
accumulator = initializer ? initializer() : {};
|
||||||
|
|
||||||
return func(collection, setter, getIteratee(iteratee), accumulator);
|
return func(collection, setter, getIteratee(iteratee, 2), accumulator);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6463,7 +6463,7 @@
|
|||||||
iteratee = undefined;
|
iteratee = undefined;
|
||||||
}
|
}
|
||||||
return isArrayLikeObject(array)
|
return isArrayLikeObject(array)
|
||||||
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee))
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -7017,7 +7017,7 @@
|
|||||||
mapped.pop();
|
mapped.pop();
|
||||||
}
|
}
|
||||||
return (mapped.length && mapped[0] === arrays[0])
|
return (mapped.length && mapped[0] === arrays[0])
|
||||||
? baseIntersection(mapped, getIteratee(iteratee))
|
? baseIntersection(mapped, getIteratee(iteratee, 2))
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -7242,7 +7242,7 @@
|
|||||||
*/
|
*/
|
||||||
function pullAllBy(array, values, iteratee) {
|
function pullAllBy(array, values, iteratee) {
|
||||||
return (array && array.length && values && values.length)
|
return (array && array.length && values && values.length)
|
||||||
? basePullAll(array, values, getIteratee(iteratee))
|
? basePullAll(array, values, getIteratee(iteratee, 2))
|
||||||
: array;
|
: array;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7469,7 +7469,7 @@
|
|||||||
* // => 0
|
* // => 0
|
||||||
*/
|
*/
|
||||||
function sortedIndexBy(array, value, iteratee) {
|
function sortedIndexBy(array, value, iteratee) {
|
||||||
return baseSortedIndexBy(array, value, getIteratee(iteratee));
|
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7548,7 +7548,7 @@
|
|||||||
* // => 1
|
* // => 1
|
||||||
*/
|
*/
|
||||||
function sortedLastIndexBy(array, value, iteratee) {
|
function sortedLastIndexBy(array, value, iteratee) {
|
||||||
return baseSortedIndexBy(array, value, getIteratee(iteratee), true);
|
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7617,7 +7617,7 @@
|
|||||||
*/
|
*/
|
||||||
function sortedUniqBy(array, iteratee) {
|
function sortedUniqBy(array, iteratee) {
|
||||||
return (array && array.length)
|
return (array && array.length)
|
||||||
? baseSortedUniq(array, getIteratee(iteratee))
|
? baseSortedUniq(array, getIteratee(iteratee, 2))
|
||||||
: [];
|
: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7840,7 +7840,7 @@
|
|||||||
if (isArrayLikeObject(iteratee)) {
|
if (isArrayLikeObject(iteratee)) {
|
||||||
iteratee = undefined;
|
iteratee = undefined;
|
||||||
}
|
}
|
||||||
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee));
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7919,7 +7919,7 @@
|
|||||||
*/
|
*/
|
||||||
function uniqBy(array, iteratee) {
|
function uniqBy(array, iteratee) {
|
||||||
return (array && array.length)
|
return (array && array.length)
|
||||||
? baseUniq(array, getIteratee(iteratee))
|
? baseUniq(array, getIteratee(iteratee, 2))
|
||||||
: [];
|
: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8093,7 +8093,7 @@
|
|||||||
if (isArrayLikeObject(iteratee)) {
|
if (isArrayLikeObject(iteratee)) {
|
||||||
iteratee = undefined;
|
iteratee = undefined;
|
||||||
}
|
}
|
||||||
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee));
|
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15787,7 +15787,7 @@
|
|||||||
*/
|
*/
|
||||||
function maxBy(array, iteratee) {
|
function maxBy(array, iteratee) {
|
||||||
return (array && array.length)
|
return (array && array.length)
|
||||||
? baseExtremum(array, getIteratee(iteratee), baseGt)
|
? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
|
||||||
: undefined;
|
: undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15833,7 +15833,7 @@
|
|||||||
* // => 5
|
* // => 5
|
||||||
*/
|
*/
|
||||||
function meanBy(array, iteratee) {
|
function meanBy(array, iteratee) {
|
||||||
return baseMean(array, getIteratee(iteratee));
|
return baseMean(array, getIteratee(iteratee, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15885,7 +15885,7 @@
|
|||||||
*/
|
*/
|
||||||
function minBy(array, iteratee) {
|
function minBy(array, iteratee) {
|
||||||
return (array && array.length)
|
return (array && array.length)
|
||||||
? baseExtremum(array, getIteratee(iteratee), baseLt)
|
? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
|
||||||
: undefined;
|
: undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15995,7 +15995,7 @@
|
|||||||
*/
|
*/
|
||||||
function sumBy(array, iteratee) {
|
function sumBy(array, iteratee) {
|
||||||
return (array && array.length)
|
return (array && array.length)
|
||||||
? baseSum(array, getIteratee(iteratee))
|
? baseSum(array, getIteratee(iteratee, 2))
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user