1.0.1 • Published 4 years ago
flat-zip v1.0.1
flat-zip
Merges arrays like a zipper. Like
lodash.zip().flat().take(limit)
but a tenth of the size!
Install
npm install flat-zip
import {flatZip} from 'flat-zip';
const {flatZip} = require('flat-zip');
Usage
flatZip([
['a', 'b', 'c'],
['€', '฿'],
[100, 200, 300, 400, 500],
]);
// -> ['a', '€', 100, 'b', '฿', 200, 'c', 300, 400, 500]
With a length limit:
flatZip([
['a', 'b', 'c'],
['€', '฿'],
[100, 200, 300, 400, 500],
], 4);
// -> ['a', '€', 100, 'b']
License
MIT © Federico Brigante