( blockType: string, blockConfig: BlockConfig, subBlocks: Record<string, SubBlockWithValue> | undefined, baseOutputs: OutputDefinition )
| 228 | } |
| 229 | |
| 230 | function applyInputFormatToOutputs( |
| 231 | blockType: string, |
| 232 | blockConfig: BlockConfig, |
| 233 | subBlocks: Record<string, SubBlockWithValue> | undefined, |
| 234 | baseOutputs: OutputDefinition |
| 235 | ): OutputDefinition { |
| 236 | if (!hasInputFormat(blockConfig) || !subBlocks?.inputFormat?.value) { |
| 237 | return baseOutputs |
| 238 | } |
| 239 | |
| 240 | const normalizedInputFormat = normalizeInputFormatValue(subBlocks.inputFormat.value) |
| 241 | |
| 242 | if (!Array.isArray(subBlocks.inputFormat.value)) { |
| 243 | if (blockType === TRIGGER_TYPES.API || blockType === TRIGGER_TYPES.INPUT) { |
| 244 | return {} |
| 245 | } |
| 246 | return baseOutputs |
| 247 | } |
| 248 | |
| 249 | const shouldClear = shouldClearBaseOutputs(blockType, normalizedInputFormat) |
| 250 | const outputs = shouldClear ? {} : { ...baseOutputs } |
| 251 | |
| 252 | return applyInputFormatFields(normalizedInputFormat, outputs) |
| 253 | } |
| 254 | |
| 255 | export function getBlockOutputs( |
| 256 | blockType: string, |
no test coverage detected