npm.io
1.0.1 • Published 6 years ago

flat-zip

Licence
MIT
Version
1.0.1
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
10

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

Keywords