mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Ensure _.sortBy works with the matchesProperty shorthand.
This commit is contained in:
16
lodash.js
16
lodash.js
@@ -4607,7 +4607,10 @@
|
|||||||
*/
|
*/
|
||||||
function createOver(arrayFunc) {
|
function createOver(arrayFunc) {
|
||||||
return rest(function(iteratees) {
|
return rest(function(iteratees) {
|
||||||
iteratees = arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), getIteratee());
|
iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
|
||||||
|
? arrayMap(iteratees[0], getIteratee())
|
||||||
|
: arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), getIteratee());
|
||||||
|
|
||||||
return rest(function(args) {
|
return rest(function(args) {
|
||||||
var thisArg = this;
|
var thisArg = this;
|
||||||
return arrayFunc(iteratees, function(iteratee) {
|
return arrayFunc(iteratees, function(iteratee) {
|
||||||
@@ -8954,7 +8957,11 @@
|
|||||||
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
||||||
iteratees = [iteratees[0]];
|
iteratees = [iteratees[0]];
|
||||||
}
|
}
|
||||||
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
|
iteratees = (length == 1 && isArray(iteratees[0]))
|
||||||
|
? iteratees[0]
|
||||||
|
: baseFlatten(iteratees, 1, isFlattenableIteratee);
|
||||||
|
|
||||||
|
return baseOrderBy(collection, iteratees, []);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
@@ -9652,7 +9659,10 @@
|
|||||||
* // => [100, 10]
|
* // => [100, 10]
|
||||||
*/
|
*/
|
||||||
var overArgs = rest(function(func, transforms) {
|
var overArgs = rest(function(func, transforms) {
|
||||||
transforms = arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), getIteratee());
|
transforms = (transforms.length == 1 && isArray(transforms[0]))
|
||||||
|
? arrayMap(transforms[0], getIteratee())
|
||||||
|
: arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), getIteratee());
|
||||||
|
|
||||||
var funcsLength = transforms.length;
|
var funcsLength = transforms.length;
|
||||||
return rest(function(args) {
|
return rest(function(args) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
|
|||||||
Reference in New Issue
Block a user