MCPcopy Create free account
hub / github.com/simstudioai/sim / getPreview

Function getPreview

apps/sim/lib/execution/payloads/large-array-manifest.ts:63–77  ·  view source on GitHub ↗
(items: unknown[])

Source from the content-addressed store, hash-verified

61}
62
63function getPreview(items: unknown[]): unknown[] {
64 const preview: unknown[] = []
65 for (const item of items.slice(0, 3)) {
66 const candidate = [...preview, item]
67 try {
68 if (measureJson(candidate).size > LARGE_ARRAY_MANIFEST_PREVIEW_MAX_BYTES) {
69 break
70 }
71 } catch {
72 break
73 }
74 preview.push(item)
75 }
76 return preview
77}
78
79function measureArrayElementJsonSize(item: unknown): number {
80 const measured = measureJson([item])

Callers 2

createLargeArrayManifestFunction · 0.70
appendLargeArrayManifestFunction · 0.70

Calls 2

measureJsonFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected