MCPcopy Index your code
hub / github.com/TanStack/db / setPairs

Method setPairs

packages/db/src/utils/btree.ts:296–302  ·  view source on GitHub ↗

Adds all pairs from a list of key-value pairs. * @param pairs Pairs to add to this tree. If there are duplicate keys, * later pairs currently overwrite earlier ones (e.g. [[0,1],[0,7]] * associates 0 with 7.) * @param overwrite Whether to overwrite pairs that already exist

(pairs: Array<[K, V]>, overwrite?: boolean)

Source from the content-addressed store, hash-verified

294 * @description Computational complexity: O(pairs.length * log(size + pairs.length))
295 */
296 setPairs(pairs: Array<[K, V]>, overwrite?: boolean): number {
297 let added = 0
298 for (const pair of pairs) {
299 if (this.set(pair[0], pair[1], overwrite)) added++
300 }
301 return added
302 }
303
304 forRange(
305 low: K,

Callers 1

constructorMethod · 0.95

Calls 1

setMethod · 0.95

Tested by

no test coverage detected