mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Add fp.zipAll.
This commit is contained in:
@@ -76,7 +76,7 @@ exports.aryMethod = {
|
||||
'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||
'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest',
|
||||
'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd',
|
||||
'trimStart', 'uniqueId', 'words'
|
||||
'trimStart', 'uniqueId', 'words', 'zipAll'
|
||||
],
|
||||
'2': [
|
||||
'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
|
||||
@@ -214,7 +214,8 @@ exports.methodSpread = {
|
||||
'mergeAllWith': { 'afterRearg': true, 'start': 1 },
|
||||
'partial': { 'start': 1 },
|
||||
'partialRight': { 'start': 1 },
|
||||
'without': { 'start': 1 }
|
||||
'without': { 'start': 1 },
|
||||
'zipAll': { 'start': 0 }
|
||||
};
|
||||
|
||||
/** Used to identify methods which mutate arrays or objects. */
|
||||
@@ -313,7 +314,8 @@ exports.remap = {
|
||||
'spreadFrom': 'spread',
|
||||
'trimChars': 'trim',
|
||||
'trimCharsEnd': 'trimEnd',
|
||||
'trimCharsStart': 'trimStart'
|
||||
'trimCharsStart': 'trimStart',
|
||||
'zipAll': 'zip'
|
||||
};
|
||||
|
||||
/** Used to track methods that skip fixing their arity. */
|
||||
|
||||
@@ -2234,6 +2234,18 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('fp.zipAll');
|
||||
|
||||
(function() {
|
||||
QUnit.test('should zip together an array of arrays', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.deepEqual(fp.zipAll([[1, 2], [3, 4], [5, 6]]), [[1, 3, 5], [2, 4, 6]]);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('fp.zipObject');
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user