MCPcopy Create free account
hub / github.com/TanStack/db / #findIndex

Method #findIndex

packages/db-ivm/src/operators/topKArray.ts:250–254  ·  view source on GitHub ↗
(value: V)

Source from the content-addressed store, hash-verified

248 // so i have the feeling there is a common pattern here and we can implement both cases using that pattern
249
250 #findIndex(value: V): number {
251 return binarySearch(this.#sortedValues, indexedValue(value, ``), (a, b) =>
252 this.#comparator(getValue(a), getValue(b)),
253 )
254 }
255}

Callers 2

insertMethod · 0.95
deleteMethod · 0.95

Calls 3

binarySearchFunction · 0.85
indexedValueFunction · 0.85
getValueFunction · 0.70

Tested by

no test coverage detected