Returns the next pair whose key is larger than the specified key (or undefined if there is none). * If key === undefined, this function returns the lowest pair. * @param key The key to search for. * @param reusedArray Optional array used repeatedly to store key-value pairs, to * avoid cr
(key: K | undefined, reusedArray?: [K, V])
| 242 | * avoid creating a new array on every iteration. |
| 243 | */ |
| 244 | nextHigherPair(key: K | undefined, reusedArray?: [K, V]): [K, V] | undefined { |
| 245 | reusedArray = reusedArray || ([] as unknown as [K, V]) |
| 246 | if (key === undefined) { |
| 247 | return this._root.minPair(reusedArray) |
| 248 | } |
| 249 | return this._root.getPairOrNextHigher( |
| 250 | key, |
| 251 | this._compare, |
| 252 | false, |
| 253 | reusedArray, |
| 254 | ) |
| 255 | } |
| 256 | |
| 257 | /** Returns the next key larger than the specified key, or undefined if there is none. |
| 258 | * Also, nextHigherKey(undefined) returns the lowest key. |
no test coverage detected