@strong-roots-capital/zip
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

zip Build status npm version codecov

Stitch together two arrays by like-index

Why yet-another zip?

I needed a zip that

  • doesn't modify Array prototype
  • is strongly-typed
  • supports currying

Install

npm install @strong-roots-capital/zip

Use

import zip from '@strong-roots-capital/zip'

/* Basic use */
const a = [1, 2, 3]
const b = ['a', 'b', 'c']
console.log(zip(a, b))
//=>[ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ]

const zipWithA = zip(a.reverse())
console.log(zipWithA(b))
//=>[ [ 3, 'a' ], [ 2, 'b' ], [ 1, 'c' ] ]

Related

Readme

Keywords

Package Sidebar

Install

npm i @strong-roots-capital/zip

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

4.89 kB

Total Files

4

Last publish

Collaborators

  • amchelle
  • hamroctopus