mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Flip iteratee arguments for fp.reduceRight.
This commit is contained in:
@@ -167,7 +167,8 @@ exports.iterateeAry = {
|
|||||||
|
|
||||||
/** Used to map method names to iteratee rearg configs. */
|
/** Used to map method names to iteratee rearg configs. */
|
||||||
exports.iterateeRearg = {
|
exports.iterateeRearg = {
|
||||||
'mapKeys': [1]
|
'mapKeys': [1],
|
||||||
|
'reduceRight': [1, 0]
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Used to map method names to rearg configs. */
|
/** Used to map method names to rearg configs. */
|
||||||
|
|||||||
@@ -1847,7 +1847,7 @@
|
|||||||
args || (args = slice.call(arguments));
|
args || (args = slice.call(arguments));
|
||||||
})(0)([1, 2, 3]);
|
})(0)([1, 2, 3]);
|
||||||
|
|
||||||
assert.deepEqual(args, isReduce ? [0, 1] : [0, 3]);
|
assert.deepEqual(args, isReduce ? [0, 1] : [3, 0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('`fp.' + methodName + '` should provide the correct `iteratee` arguments when iterating an object', function(assert) {
|
QUnit.test('`fp.' + methodName + '` should provide the correct `iteratee` arguments when iterating an object', function(assert) {
|
||||||
@@ -1858,8 +1858,8 @@
|
|||||||
isFIFO = _.keys(object)[0] == 'a';
|
isFIFO = _.keys(object)[0] == 'a';
|
||||||
|
|
||||||
var expected = isFIFO
|
var expected = isFIFO
|
||||||
? (isReduce ? [0, 1] : [0, 2])
|
? (isReduce ? [0, 1] : [2, 0])
|
||||||
: (isReduce ? [0, 2] : [0, 1]);
|
: (isReduce ? [0, 2] : [1, 0]);
|
||||||
|
|
||||||
func(function() {
|
func(function() {
|
||||||
args || (args = slice.call(arguments));
|
args || (args = slice.call(arguments));
|
||||||
|
|||||||
Reference in New Issue
Block a user