flat-zip

1.0.1 • Public • Published

flat-zip

Concats arrays but does so like a zipper instead of appending them. Like lodash.zip + lodash.flat, plus a length limit

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

Package Sidebar

Install

npm i flat-zip

Weekly Downloads

890

Version

1.0.1

License

MIT

Unpacked Size

4.88 kB

Total Files

7

Last publish

Collaborators

  • fregante