* Whether a range predicate (gt/gte/lt/lte) on this operand can be safely * served by the given index: the operand's domain must order the same way the * index does, and the index itself must support trustworthy range traversal * (no custom comparator).
( value: unknown, index: IndexInterface<any>, collection: CollectionLike<any, any>, )
| 180 | * (no custom comparator). |
| 181 | */ |
| 182 | function canRangeOptimize( |
| 183 | value: unknown, |
| 184 | index: IndexInterface<any>, |
| 185 | collection: CollectionLike<any, any>, |
| 186 | ): boolean { |
| 187 | return ( |
| 188 | !isRangeOrderingDivergent(value, collection) && |
| 189 | index.supportsRangeOptimization |
| 190 | ) |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * Optimizes a query expression using available indexes to find matching keys |
no test coverage detected