Flip iteratee arguments for fp.reduceRight.

This commit is contained in:
John-David Dalton
2016-11-19 23:44:52 -06:00
parent dd0d984d37
commit 86ee93650d
2 changed files with 5 additions and 4 deletions

View File

@@ -167,7 +167,8 @@ exports.iterateeAry = {
/** Used to map method names to iteratee rearg configs. */
exports.iterateeRearg = {
'mapKeys': [1]
'mapKeys': [1],
'reduceRight': [1, 0]
};
/** Used to map method names to rearg configs. */

View File

@@ -1847,7 +1847,7 @@
args || (args = slice.call(arguments));
})(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) {
@@ -1858,8 +1858,8 @@
isFIFO = _.keys(object)[0] == 'a';
var expected = isFIFO
? (isReduce ? [0, 1] : [0, 2])
: (isReduce ? [0, 2] : [0, 1]);
? (isReduce ? [0, 1] : [2, 0])
: (isReduce ? [0, 2] : [1, 0]);
func(function() {
args || (args = slice.call(arguments));