@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.
13 lines (12 loc) • 490 B
TypeScript
type FlatMapOptions<TRecord, TMappedRecord> = {
transformer: (record: TRecord) => Array<TMappedRecord>;
records: Array<TRecord>;
};
/**
* @description
* Use this method to map each record to zero or more records, then flatten the results into a single new RecordSet.
*
* This is handy for extracting nested arrays or expanding items.
*/
export declare const flatMap: <TRecord, TMappedRecord>(options: FlatMapOptions<TRecord, TMappedRecord>) => Array<TMappedRecord>;
export {};