reports/frontend/node_modules/es-toolkit/dist/array/unzip.d.mts
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

18 lines
No EOL
664 B
TypeScript

//#region src/array/unzip.d.ts
/**
* Gathers elements in the same position in an internal array
* from a grouped array of elements and returns them as a new array.
*
* @template T - The type of elements in the nested array.
* @param zipped - The nested array to unzip.
* @returns A new array of unzipped elements.
*
* @example
* const zipped = [['a', true, 1],['b', false, 2]];
* const result = unzip(zipped);
* // result will be [['a', 'b'], [true, false], [1, 2]]
*/
declare function unzip<T extends unknown[]>(zipped: ReadonlyArray<[...T]>): Unzip<T>;
type Unzip<K extends unknown[]> = { [I in keyof K]: Array<K[I]> };
//#endregion
export { unzip };