(subBlock: SubBlockConfig)
| 27 | } |
| 28 | |
| 29 | function 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 | |
| 53 | function buildStartBlockConfig(): BlockConfig { |
| 54 | const blockConfig = getBlock(START_BLOCK_TYPE) |
no test coverage detected