Function
chunkedArrayPush
(array: Array<unknown>, other: Array<unknown>)
Source from the content-addressed store, hash-verified
| 47 | // TODO: investigate the performance of this and other approaches |
| 48 | const chunkSize = 30000 |
| 49 | export 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 | |
| 60 | export function binarySearch<T>( |
| 61 | array: Array<T>, |
Tested by
no test coverage detected