@future-widget-lab/record-set
Version:
A dedicated data structure for in-memory record collections, offering fluent, immutable APIs for MongoDB-like querying, sorting, and transformation.
12 lines (11 loc) • 412 B
TypeScript
type ReduceOptions<TRecord, TAccumulator> = {
reducer: (accumulator: TAccumulator, record: TRecord) => TAccumulator;
initialValue: TAccumulator;
records: Array<TRecord>;
};
/**
* @description
* Use this helper to reduce the record set to a single accumulated value.
*/
export declare const reduce: <TRecord, TAccumulator>(options: ReduceOptions<TRecord, TAccumulator>) => TAccumulator;
export {};