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

Function readMetadataSubBlockValue

apps/sim/executor/utils/start-block.ts:112–128  ·  view source on GitHub ↗
(block: SerializedBlock, key: string)

Source from the content-addressed store, hash-verified

110}
111
112function readMetadataSubBlockValue(block: SerializedBlock, key: string): unknown {
113 const metadata = block.metadata
114 if (!metadata || typeof metadata !== 'object') {
115 return undefined
116 }
117
118 const maybeWithSubBlocks = metadata as typeof metadata & {
119 subBlocks?: Record<string, unknown>
120 }
121
122 const raw = maybeWithSubBlocks.subBlocks?.[key]
123 if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
124 return undefined
125 }
126
127 return (raw as { value?: unknown }).value
128}
129
130function extractInputFormat(block: SerializedBlock): InputFormatField[] {
131 const fromMetadata = readMetadataSubBlockValue(block, 'inputFormat')

Callers 2

extractInputFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected