@polkadot/util
Version:
A collection of useful utilities for @polkadot
16 lines (15 loc) • 363 B
TypeScript
/**
* @name arrayFlatten
* @summary Merge T[][] into T[]
* @description
* Returns a new array with all arrays merged into one
* @example
* <BR>
*
* ```javascript
* import { arrayFlatten } from '@polkadot/util';
*
* arrayFlatten([[1, 2], [3, 4], [5]]); // [1, 2, 3, 4, 5]
* ```
*/
export declare function arrayFlatten<T>(arrays: readonly T[][]): T[];