UNPKG

typedash

Version:

modern, type-safe collection of utility functions

19 lines (16 loc) 676 B
import { TypedArray } from 'type-fest'; /** * Zips two arrays together into an array of tuples. * @param first The first array to zip. * @param second The second array to zip. * @returns An array of tuples containing the zipped values. */ declare function zip<T, U>(first: readonly T[], second: readonly U[]): Array<[T, U]>; /** * Zips two typed arrays together into an array of tuples. * @param first The first array to zip. * @param second The second array to zip. * @returns An array of tuples containing the zipped values. */ declare function zip<T extends TypedArray, U extends TypedArray>(first: T, second: U): Array<[T[number], U[number]]>; export { zip };