From 784ee6a086742d606985f6e5259488b109cccc3e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 10 Feb 2016 08:19:59 -0800 Subject: [PATCH] Remove fp `iterateeRearg` mapping. [closes #1971] --- fp/_baseConvert.js | 16 ++-------------- fp/_mapping.js | 7 ------- test/test-fp.js | 22 ---------------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index 3dd940401..96cc185f4 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -109,13 +109,6 @@ function baseConvert(util, name, func, options) { }); }; - var iterateeRearg = function(func, indexes) { - return overArg(func, function(func) { - var n = indexes.length; - return baseArity(rearg(baseAry(func, n), indexes), n); - }); - }; - var overArg = function(func, iteratee, retArg) { return function() { var length = arguments.length; @@ -207,7 +200,6 @@ function baseConvert(util, name, func, options) { each(mapping.aryMethod[cap], function(otherName) { if (name == otherName) { var aryN = !isLib && mapping.iterateeAry[name], - reargIndexes = mapping.iterateeRearg[name], spreadStart = mapping.methodSpread[name]; result = wrapped; @@ -219,12 +211,8 @@ function baseConvert(util, name, func, options) { if (config.rearg && cap > 1 && (forceRearg || !mapping.skipRearg[name])) { result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); } - if (config.cap) { - if (reargIndexes) { - result = iterateeRearg(result, reargIndexes); - } else if (aryN) { - result = iterateeAry(result, aryN); - } + if (config.cap && aryN) { + result = iterateeAry(result, aryN); } if (config.curry && cap > 1) { result = curry(result, cap); diff --git a/fp/_mapping.js b/fp/_mapping.js index 8975c1dd6..d3c65fbaa 100644 --- a/fp/_mapping.js +++ b/fp/_mapping.js @@ -127,13 +127,6 @@ exports.iterateeAry = { 'transform': 2 }; -/** Used to map method names to iteratee rearg configs. */ -exports.iterateeRearg = { - 'findKey': [1], - 'findLastKey': [1], - 'mapKeys': [1] -}; - /** Used to map method names to rearg configs. */ exports.methodRearg = { 'assignInWith': [1, 2, 0], diff --git a/test/test-fp.js b/test/test-fp.js index c4345340e..9662fcc65 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -458,28 +458,6 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('key methods'); - - (function() { - var object = { 'a': 1 }; - - QUnit.test('should provide the correct `iteratee` arguments', function(assert) { - assert.expect(3); - - _.each(['findKey', 'findLastKey', 'mapKeys'], function(methodName) { - var args; - - var actual = fp[methodName](function() { - args || (args = slice.call(arguments)); - }, object); - - assert.deepEqual(args, ['a'], 'fp.' + methodName); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - QUnit.module('mutation methods'); (function() {