js-fns
Version:
Modern JavaScript utility library focused on the build size
10 lines (9 loc) • 390 B
TypeScript
/**
* Creates an array with elements present in all given arrays.
*
* @param arrays - The array of arrays of elements to get elements from
* @returns An array with elements present in all given arrays
*
* @public
*/
export default function zip<ElementsArray extends any[][]>(...arrays: ElementsArray): ElementsArray extends Array<Array<infer ElementType>> ? ElementType[][] : never;