{"version":3,"sources":["../../src/functions/zip/zip.ts"],"names":[],"mappings":";AA4BO,SAAS,IAGd,OAAU,QAAW;AACrB,QAAM,SAAwC,CAAC;AAE/C,WAAS,QAAQ,GAAG,QAAQ,KAAK,IAAI,MAAM,QAAQ,OAAO,MAAM,GAAG,SAAS;AAE1E,WAAO,KAAK,CAAC,MAAM,KAAK,GAAI,OAAO,KAAK,CAAE,CAAC;AAAA,EAC7C;AAEA,SAAO;AACT","sourcesContent":["import type { TypedArray } from 'type-fest';\n\n/**\n * Zips two arrays together into an array of tuples.\n * @param first The first array to zip.\n * @param second The second array to zip.\n * @returns An array of tuples containing the zipped values.\n */\nexport function zip<T, U>(\n  first: readonly T[],\n  second: readonly U[]\n): Array<[T, U]>;\n/**\n * Zips two typed arrays together into an array of tuples.\n * @param first The first array to zip.\n * @param second The second array to zip.\n * @returns An array of tuples containing the zipped values.\n */\nexport function zip<T extends TypedArray, U extends TypedArray>(\n  first: T,\n  second: U\n): Array<[T[number], U[number]]>;\n/**\n * Implementation for all overloads.\n * @param first The first array to zip.\n * @param second The second array to zip.\n * @returns An array of tuples containing the zipped values.\n */\nexport function zip<\n  T extends readonly unknown[] | TypedArray,\n  U extends readonly unknown[] | TypedArray,\n>(first: T, second: U) {\n  const result: Array<[T[number], U[number]]> = [];\n\n  for (let index = 0; index < Math.min(first.length, second.length); index++) {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- we're getting the min length first\n    result.push([first[index]!, second[index]!]);\n  }\n\n  return result;\n}\n"]}