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

Function resolveInitialValue

apps/sim/lib/workflows/defaults.ts:29–51  ·  view source on GitHub ↗
(subBlock: SubBlockConfig)

Source from the content-addressed store, hash-verified

27}
28
29function resolveInitialValue(subBlock: SubBlockConfig): unknown {
30 if (typeof subBlock.value === 'function') {
31 try {
32 return cloneDefaultValue(subBlock.value({}))
33 } catch (error) {
34 // Ignore resolution errors and fall back to default/null values
35 }
36 }
37
38 if (subBlock.defaultValue !== undefined) {
39 return cloneDefaultValue(subBlock.defaultValue)
40 }
41
42 if (subBlock.type === 'input-format') {
43 return [createDefaultInputFormatField()]
44 }
45
46 if (subBlock.type === 'table') {
47 return []
48 }
49
50 return null
51}
52
53function buildStartBlockConfig(): BlockConfig {
54 const blockConfig = getBlock(START_BLOCK_TYPE)

Callers 1

buildStartBlockStateFunction · 0.85

Calls 2

cloneDefaultValueFunction · 0.85

Tested by

no test coverage detected