@plasma-fi/sdk
Version:
🛠An SDK for building dapp on PlasmaSwap.
10 lines (9 loc) • 361 B
TypeScript
/**
* Given an array of items sorted by `comparator`, insert an item into its sort index and constrain the size to
* `maxSize` by removing the last item
* @param items
* @param add
* @param maxSize
* @param comparator
*/
export declare function sortedInsert<T>(items: T[], add: T, maxSize: number, comparator: (a: T, b: T) => number): T | null;