diff --git a/fp/_mapping.js b/fp/_mapping.js index 73440c917..784ae36db 100644 --- a/fp/_mapping.js +++ b/fp/_mapping.js @@ -71,11 +71,11 @@ exports.aryMethod = { '3': [ 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs', - 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith', 'orderBy', - 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', 'pullAllWith', - 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', - 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', - 'xorBy', 'xorWith', 'zipWith' + 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith', + 'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', + 'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice', + 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', + 'update', 'xorBy', 'xorWith', 'zipWith' ], '4': [ 'fill', 'setWith', 'updateWith' @@ -142,6 +142,7 @@ exports.methodRearg = { 'assignWith': [1, 2, 0], 'getOr': [2, 1, 0], 'invokeArgs': [1, 0, 2], + 'invokeArgsMap': [1, 0, 2], 'isMatchWith': [2, 1, 0], 'mergeWith': [1, 2, 0], 'padChars': [2, 1, 0], @@ -159,6 +160,7 @@ exports.methodRearg = { /** Used to map method names to spread configs. */ exports.methodSpread = { 'invokeArgs': 2, + 'invokeArgsMap': 2, 'partial': 1, 'partialRight': 1 }; @@ -227,6 +229,7 @@ exports.remap = { 'curryRightN': 'curryRight', 'getOr': 'get', 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', 'padChars': 'pad', 'padCharsEnd': 'padEnd', 'padCharsStart': 'padStart', diff --git a/test/test-fp.js b/test/test-fp.js index 84fa0b2bf..baaedd2e6 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -1176,6 +1176,19 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.invokeMap'); + + (function() { + QUnit.test('should not accept an `args` param', function(assert) { + assert.expect(1); + + var actual = fp.invokeMap('toUpperCase')(['a', 'b']); + assert.deepEqual(actual, ['A', 'B']); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.invokeArgs'); (function() { @@ -1189,6 +1202,19 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.invokeArgsMap'); + + (function() { + QUnit.test('should accept an `args` param', function(assert) { + assert.expect(1); + + var actual = fp.invokeArgsMap('concat')(['a', 'A'])(['b', 'c']); + assert.deepEqual(actual, ['abc', 'Abc']); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.iteratee'); (function() {