mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Add fp.invokeArgsMap.
This commit is contained in:
@@ -71,11 +71,11 @@ exports.aryMethod = {
|
|||||||
'3': [
|
'3': [
|
||||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||||
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
|
||||||
'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith', 'orderBy',
|
'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
|
||||||
'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', 'pullAllWith',
|
'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
|
||||||
'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy',
|
'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
|
||||||
'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update',
|
'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
|
||||||
'xorBy', 'xorWith', 'zipWith'
|
'update', 'xorBy', 'xorWith', 'zipWith'
|
||||||
],
|
],
|
||||||
'4': [
|
'4': [
|
||||||
'fill', 'setWith', 'updateWith'
|
'fill', 'setWith', 'updateWith'
|
||||||
@@ -142,6 +142,7 @@ exports.methodRearg = {
|
|||||||
'assignWith': [1, 2, 0],
|
'assignWith': [1, 2, 0],
|
||||||
'getOr': [2, 1, 0],
|
'getOr': [2, 1, 0],
|
||||||
'invokeArgs': [1, 0, 2],
|
'invokeArgs': [1, 0, 2],
|
||||||
|
'invokeArgsMap': [1, 0, 2],
|
||||||
'isMatchWith': [2, 1, 0],
|
'isMatchWith': [2, 1, 0],
|
||||||
'mergeWith': [1, 2, 0],
|
'mergeWith': [1, 2, 0],
|
||||||
'padChars': [2, 1, 0],
|
'padChars': [2, 1, 0],
|
||||||
@@ -159,6 +160,7 @@ exports.methodRearg = {
|
|||||||
/** Used to map method names to spread configs. */
|
/** Used to map method names to spread configs. */
|
||||||
exports.methodSpread = {
|
exports.methodSpread = {
|
||||||
'invokeArgs': 2,
|
'invokeArgs': 2,
|
||||||
|
'invokeArgsMap': 2,
|
||||||
'partial': 1,
|
'partial': 1,
|
||||||
'partialRight': 1
|
'partialRight': 1
|
||||||
};
|
};
|
||||||
@@ -227,6 +229,7 @@ exports.remap = {
|
|||||||
'curryRightN': 'curryRight',
|
'curryRightN': 'curryRight',
|
||||||
'getOr': 'get',
|
'getOr': 'get',
|
||||||
'invokeArgs': 'invoke',
|
'invokeArgs': 'invoke',
|
||||||
|
'invokeArgsMap': 'invokeMap',
|
||||||
'padChars': 'pad',
|
'padChars': 'pad',
|
||||||
'padCharsEnd': 'padEnd',
|
'padCharsEnd': 'padEnd',
|
||||||
'padCharsStart': 'padStart',
|
'padCharsStart': 'padStart',
|
||||||
|
|||||||
@@ -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');
|
QUnit.module('fp.invokeArgs');
|
||||||
|
|
||||||
(function() {
|
(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');
|
QUnit.module('fp.iteratee');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user