@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.
11 lines (10 loc) • 374 B
TypeScript
type PluckOptions<TRecord, TKey extends keyof TRecord> = {
field: TKey;
records: Array<TRecord>;
};
/**
* @description
* Use this helper to extract an array of a single field's values from all records in the record set.
*/
export declare const pluck: <TRecord, TKey extends keyof TRecord>(options: PluckOptions<TRecord, TKey>) => Array<TRecord[TKey]>;
export {};