Add fp.zipAll.

This commit is contained in:
John-David Dalton
2016-07-10 16:25:29 -07:00
parent 8bc44e3bff
commit 8cb5455671
2 changed files with 17 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ exports.aryMethod = {
'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'mergeAll', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest',
'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd',
'trimStart', 'uniqueId', 'words' 'trimStart', 'uniqueId', 'words', 'zipAll'
], ],
'2': [ '2': [
'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
@@ -214,7 +214,8 @@ exports.methodSpread = {
'mergeAllWith': { 'afterRearg': true, 'start': 1 }, 'mergeAllWith': { 'afterRearg': true, 'start': 1 },
'partial': { 'start': 1 }, 'partial': { 'start': 1 },
'partialRight': { 'start': 1 }, 'partialRight': { 'start': 1 },
'without': { 'start': 1 } 'without': { 'start': 1 },
'zipAll': { 'start': 0 }
}; };
/** Used to identify methods which mutate arrays or objects. */ /** Used to identify methods which mutate arrays or objects. */
@@ -313,7 +314,8 @@ exports.remap = {
'spreadFrom': 'spread', 'spreadFrom': 'spread',
'trimChars': 'trim', 'trimChars': 'trim',
'trimCharsEnd': 'trimEnd', 'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart' 'trimCharsStart': 'trimStart',
'zipAll': 'zip'
}; };
/** Used to track methods that skip fixing their arity. */ /** Used to track methods that skip fixing their arity. */

View File

@@ -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'); QUnit.module('fp.zipObject');
(function() { (function() {