parallel-es
Version:
Simple parallelization for EcmaScript
28 lines (27 loc) • 1.1 kB
TypeScript
/**
* Creates an iterator that iterates over the given array
* @param data the array
* @param T element type
* @returns the iterator
*/
export declare function toIterator<T>(data: T[]): Iterator<T>;
/**
* Converts the given iterator to an array
* @param iterator the iterator that is to be converted into an array
* @param T element type
* @returns {T[]} the array representation of the given iterator
*/
export declare function toArray<T>(iterator: Iterator<T>): T[];
/**
* Flattens the given array.
* @param deepArray the array to flatten
* @param type of the array elements
* @returns returns an array containing all the values contained in the sub arrays of deep array.
*/
export declare function flattenArray<T>(deepArray: T[][]): T[];
/**
* Appends the toAppend array to the target array. The result is stored in the target array (therefore, in place)
* @param target the first element to concat and as well as the target of the concatenation operation
* @param toAppend the array to append to target
*/
export declare function concatInPlace<T>(target: T[], toAppend: T[]): T[];