Options
All
  • Public
  • Public/Protected
  • All
Menu

npm Build Status Coverage Status Commitizen friendly

TSZIP

A typescript / javascript library that emulates the python's zip method, providing a similar interface in a javascript / typescript context.

Installation

NPM

npm install tszip

Vanilla JS / Web

Download the latest release from the release section, then include the desired script located in the ´dist´ folder (either dist/lib, either one of the js files in dist, according to what is the targeted environment).

Usage

Examples are directly available in the docs, which will be updated if any change is occurring.

To use the library in an ES6 environment, just import it:

import { tszip } from 'tszip';

Or, if you must use require:

const zip = require('tszip').zip;

There also is an example folder in this repository available providing some example usages. The webpack example is a raw clone of this repository: https://github.com/wbkd/webpack-starter.git, where I'm simply importing the library.

Index

Functions

Functions

zip

  • zip(...args: Array<any>[]): IterableIterator<any[]>
  • Make an iterator that aggregates elements from each of the iterables.

    example
    // Sample usage
    let [a,b] = [[1,2],[3,4]];
    let zipped = [...zip(a,b)]; // or Array.from(zip(a,b));
    console.log(zipped); // [[1,3],[2,4]]
    example
    // Usage as iterable.
    let [a,b] = [[1,2],[3,4]];
    for (var [c,d] of zip(a,b)) {
     // c will be 1, then 3
     // d will be 2, then 4.
     console.log('c id', c, 'd is ', d);
    }
    export

    Parameters

    • Rest ...args: Array<any>[]

    Returns IterableIterator<any[]>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc