MCPcopy
hub / github.com/simstudioai/sim / isLargeValueRef

Function isLargeValueRef

apps/sim/lib/execution/payloads/large-value-ref.ts:30–53  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

28}
29
30export function isLargeValueRef(value: unknown): value is LargeValueRef {
31 if (!value || typeof value !== 'object') return false
32
33 const candidate = value as Record<string, unknown>
34 const id = candidate.id
35 const key = candidate.key
36 const executionId = candidate.executionId
37
38 return (
39 candidate[LARGE_VALUE_REF_MARKER] === true &&
40 candidate.version === LARGE_VALUE_REF_VERSION &&
41 typeof id === 'string' &&
42 LARGE_VALUE_ID_PATTERN.test(id) &&
43 typeof candidate.kind === 'string' &&
44 (LARGE_VALUE_KINDS as readonly string[]).includes(candidate.kind) &&
45 typeof candidate.size === 'number' &&
46 Number.isFinite(candidate.size) &&
47 candidate.size > 0 &&
48 (executionId === undefined || typeof executionId === 'string') &&
49 (key === undefined ||
50 (typeof key === 'string' &&
51 isLargeValueStorageKey(key, id, executionId as string | undefined)))
52 )
53}
54
55export function containsLargeValueRef(
56 value: unknown,

Callers 15

materializeFieldFunction · 0.90
grepFieldFunction · 0.90
transformStringsFunction · 0.90
materializeExecutionDataFunction · 0.90
collectRefsFunction · 0.90
substituteRefsFunction · 0.90
replaceRefFunction · 0.90
hydrateValueFunction · 0.90
isLargeArrayManifestFunction · 0.90

Calls 2

isLargeValueStorageKeyFunction · 0.85
testMethod · 0.80

Tested by

no test coverage detected