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

Function applyInputFormatToOutputs

apps/sim/lib/workflows/blocks/block-outputs.ts:230–253  ·  view source on GitHub ↗
(
  blockType: string,
  blockConfig: BlockConfig,
  subBlocks: Record<string, SubBlockWithValue> | undefined,
  baseOutputs: OutputDefinition
)

Source from the content-addressed store, hash-verified

228}
229
230function 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
255export function getBlockOutputs(
256 blockType: string,

Callers 1

getBlockOutputsFunction · 0.85

Calls 4

hasInputFormatFunction · 0.85
shouldClearBaseOutputsFunction · 0.85
applyInputFormatFieldsFunction · 0.85

Tested by

no test coverage detected