( table: Record<string, number>[], key: string, value: number, last?: boolean )
| 48 | * @private |
| 49 | */ |
| 50 | export const _lookupByKey = ( |
| 51 | table: Record<string, number>[], |
| 52 | key: string, |
| 53 | value: number, |
| 54 | last?: boolean |
| 55 | ) => |
| 56 | _lookup(table, value, last |
| 57 | ? index => { |
| 58 | const ti = table[index][key]; |
| 59 | return ti < value || ti === value && table[index + 1][key] === value; |
| 60 | } |
| 61 | : index => table[index][key] < value); |
| 62 | |
| 63 | /** |
| 64 | * Reverse binary search |
no test coverage detected