MCPcopy Index your code
hub / github.com/simstudioai/sim / chunkArray

Function chunkArray

apps/sim/lib/cleanup/batch-delete.ts:21–25  ·  view source on GitHub ↗
(arr: T[], size: number)

Source from the content-addressed store, hash-verified

19export const DEFAULT_DELETE_CHUNK_SIZE = 1000
20
21export function chunkArray<T>(arr: T[], size: number): T[][] {
22 const out: T[][] = []
23 for (let i = 0; i < arr.length; i += size) out.push(arr.slice(i, i + size))
24 return out
25}
26
27export interface SelectByIdChunksOptions {
28 /** Cap on rows returned across all chunks. Defaults to a full per-table cleanup budget. */

Callers 12

forEachCleanupChunkFunction · 0.90
collectChatFilesFunction · 0.90
getDependencyClosureFunction · 0.90
registerLargeValueOwnerFunction · 0.90
pruneLargeValueMetadataFunction · 0.90
selectRowsByIdChunksFunction · 0.85
chunkedBatchDeleteFunction · 0.85
deleteRowsByIdFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected