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

Function getPreview

apps/sim/lib/execution/payloads/store.ts:50–61  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

48}
49
50function getPreview(value: unknown): unknown {
51 if (typeof value === 'string') {
52 return truncate(value, 256)
53 }
54 if (Array.isArray(value)) {
55 return { length: value.length }
56 }
57 if (value && typeof value === 'object') {
58 return { keys: Object.keys(value).slice(0, 20) }
59 }
60 return value
61}
62
63async function persistValue(
64 id: string,

Callers 1

storeLargeValueFunction · 0.70

Calls 1

truncateFunction · 0.90

Tested by

no test coverage detected