Returns the next pair whose key is smaller than the specified key (or undefined if there is none). * If key === undefined, this function returns the highest pair. * @param key The key to search for. * @param reusedArray Optional array used repeatedly to store key-value pairs, to *
(key: K | undefined, reusedArray?: [K, V])
| 269 | * avoid creating a new array each time you call this method. |
| 270 | */ |
| 271 | nextLowerPair(key: K | undefined, reusedArray?: [K, V]): [K, V] | undefined { |
| 272 | reusedArray = reusedArray || ([] as unknown as [K, V]) |
| 273 | if (key === undefined) { |
| 274 | return this._root.maxPair(reusedArray) |
| 275 | } |
| 276 | return this._root.getPairOrNextLower(key, this._compare, false, reusedArray) |
| 277 | } |
| 278 | |
| 279 | /** Returns the next key smaller than the specified key, or undefined if there is none. |
| 280 | * Also, nextLowerKey(undefined) returns the highest key. |
no test coverage detected