Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/froebel/unzip.ts>default

A strictly typed utility library.
Latest
variable default
import { default } from "https://deno.land/x/froebel@v0.23.2/unzip.ts";

Reverse of zip. Takes a list of tuples and deconstructs them into an array (of length of the tuples length) of lists each containing all the elements in all tuples at the lists index.

Examples

const [nums, chars] = unzip([1,'a'], [2,'b'], [3,'c']) console.log(nums) // prints: [1, 2, 3] console.log(chars) // prints: ['a','b','c']

type

<T extends unknown[]>(...zipped: [...T][]) => Unzip<T>