* Performs a reversed range query
(options: RangeQueryOptions = {})
| 277 | * Performs a reversed range query |
| 278 | */ |
| 279 | rangeQueryReversed(options: RangeQueryOptions = {}): Set<TKey> { |
| 280 | const { from, to, fromInclusive = true, toInclusive = true } = options |
| 281 | const hasFrom = `from` in options |
| 282 | const hasTo = `to` in options |
| 283 | |
| 284 | // Swap from/to for reversed query, respecting explicit undefined values |
| 285 | return this.rangeQuery({ |
| 286 | from: hasTo ? to : this.orderedEntries.maxKey(), |
| 287 | to: hasFrom ? from : this.orderedEntries.minKey(), |
| 288 | fromInclusive: toInclusive, |
| 289 | toInclusive: fromInclusive, |
| 290 | }) |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Internal method for taking items from the index. |
nothing calls this directly
no test coverage detected