@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.
14 lines (11 loc) • 310 B
text/typescript
type ReverseOptions<TRecord> = {
records: Array<TRecord>;
};
/**
* @description
* Use this method to reverse the order of the records.
*/
export const reverse = <TRecord>(options: ReverseOptions<TRecord>) => {
const { records } = options;
return ([] as Array<TRecord>).concat(records).reverse();
};