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

Function storeArrayChunks

apps/sim/lib/execution/payloads/large-array-manifest.ts:121–138  ·  view source on GitHub ↗
(
  items: unknown[],
  context: LargeArrayManifestWriteOptions
)

Source from the content-addressed store, hash-verified

119}
120
121async function storeArrayChunks(
122 items: unknown[],
123 context: LargeArrayManifestWriteOptions
124): Promise<LargeArrayManifestChunk[]> {
125 const targetBytes = Math.max(
126 2,
127 Math.min(
128 context.chunkTargetBytes ?? LARGE_ARRAY_MANIFEST_CHUNK_TARGET_BYTES,
129 MAX_INLINE_MATERIALIZATION_BYTES
130 )
131 )
132 const chunks = chunkArrayItems(items, targetBytes)
133 const storedChunks: LargeArrayManifestChunk[] = []
134 for (const chunk of chunks) {
135 storedChunks.push(await storeArrayChunk(chunk, context))
136 }
137 return storedChunks
138}
139
140function assertLargeArrayManifest(value: LargeArrayManifest): void {
141 if (!isLargeArrayManifest(value)) {

Callers 2

createLargeArrayManifestFunction · 0.85
appendLargeArrayManifestFunction · 0.85

Calls 3

chunkArrayItemsFunction · 0.85
storeArrayChunkFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected