Remove isFlattenableIteratee predicate to resolve regression. [closes #2418]

This commit is contained in:
John-David Dalton
2016-06-13 11:08:05 -07:00
parent adac412f58
commit 9f6d6d7b37
2 changed files with 7 additions and 23 deletions

View File

@@ -4915,7 +4915,7 @@
return rest(function(iteratees) {
iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
? arrayMap(iteratees[0], baseUnary(getIteratee()))
: arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(getIteratee()));
: arrayMap(baseFlatten(iteratees, 1), baseUnary(getIteratee()));
return rest(function(args) {
var thisArg = this;
@@ -5821,18 +5821,6 @@
return isArray(value) || isArguments(value);
}
/**
* Checks if `value` is a flattenable array and not a `_.matchesProperty`
* iteratee shorthand.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenableIteratee(value) {
return isArray(value) && !(value.length == 2 && !isFunction(value[0]));
}
/**
* Checks if `value` is a valid array-like index.
*
@@ -9426,11 +9414,7 @@
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
? iteratees[0]
: baseFlatten(iteratees, 1, isFlattenableIteratee);
return baseOrderBy(collection, iteratees, []);
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
/*------------------------------------------------------------------------*/
@@ -10132,7 +10116,7 @@
var overArgs = rest(function(func, transforms) {
transforms = (transforms.length == 1 && isArray(transforms[0]))
? arrayMap(transforms[0], baseUnary(getIteratee()))
: arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(getIteratee()));
: arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
var funcsLength = transforms.length;
return rest(function(args) {