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

Function chunkedArrayPush

packages/db-ivm/src/utils.ts:49–58  ·  view source on GitHub ↗
(array: Array<unknown>, other: Array<unknown>)

Source from the content-addressed store, hash-verified

47// TODO: investigate the performance of this and other approaches
48const chunkSize = 30000
49export function chunkedArrayPush(array: Array<unknown>, other: Array<unknown>) {
50 if (other.length <= chunkSize) {
51 array.push(...other)
52 } else {
53 for (let i = 0; i < other.length; i += chunkSize) {
54 const chunk = other.slice(i, i + chunkSize)
55 array.push(...chunk)
56 }
57 }
58}
59
60export function binarySearch<T>(
61 array: Array<T>,

Callers 2

concatMethod · 0.85
extendMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected