MCPcopy Create free account
hub / github.com/TanStack/db / inArrayLookup

Method inArrayLookup

packages/db/src/indexes/basic-index.ts:470–482  ·  view source on GitHub ↗

* Performs an IN array lookup - O(k) where k is values.length

(values: Array<any>)

Source from the content-addressed store, hash-verified

468 * Performs an IN array lookup - O(k) where k is values.length
469 */
470 inArrayLookup(values: Array<any>): Set<TKey> {
471 const result = new Set<TKey>()
472
473 for (const value of values) {
474 const normalizedValue = normalizeValue(value)
475 const keys = this.valueMap.get(normalizedValue)
476 if (keys) {
477 keys.forEach((key) => result.add(key))
478 }
479 }
480
481 return result
482 }
483
484 // Getter methods for testing/compatibility
485 get indexedKeysSet(): Set<TKey> {

Callers 2

lookupMethod · 0.95

Calls 4

normalizeValueFunction · 0.85
getMethod · 0.45
forEachMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected