rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
14 lines • 689 B
TypeScript
/**
* @public
* Iterate over `ArrayLike` calling a callback against it, the callback returns `ArrayLike` which is concatenated into a single `Array`.
*
* @param items - The items to iterate over.
* @param mapCallback - The return from this callback is concatenated to the result, unless null is returned in which case the result is omitted.
*
* @returns The output of `mapCallback` flattened into a single array.
*
* @remarks
* See {@link arrayFlatMap}.
*/
export declare function arrayFlatMap<TItem, TTransformed>(items: ArrayLike<TItem>, mapCallback: (item: TItem, index: number) => ArrayLike<TTransformed> | null): TTransformed[];
//# sourceMappingURL=array-flat-map.d.ts.map