UNPKG

384 BTypeScriptView Raw
1/**
2 * @name arrayChunk
3 * @summary Split T[] into T[][] based on the defind size
4 * @description
5 * Returns a set ao arrays based on the chunksize
6 * @example
7 * <BR>
8 *
9 * ```javascript
10 * import { arrayChunk } from '@polkadot/util';
11 *
12 * arrayChunk([1, 2, 3, 4, 5]); // [[1, 2], [3, 4], [5]]
13 * ```
14 */
15export declare function arrayChunk<T>(array: T[], chunkSize: number): T[][];