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

Function normalizeInputFormatValue

apps/sim/lib/workflows/input-format.ts:219–242  ·  view source on GitHub ↗
(inputFormatValue: unknown)

Source from the content-addressed store, hash-verified

217 * @returns Array of validated input format fields
218 */
219export function normalizeInputFormatValue(inputFormatValue: unknown): InputFormatField[] {
220 // Handle null, undefined, and empty arrays
221 if (
222 inputFormatValue === null ||
223 inputFormatValue === undefined ||
224 (Array.isArray(inputFormatValue) && inputFormatValue.length === 0)
225 ) {
226 return []
227 }
228
229 // Handle non-array values
230 if (!Array.isArray(inputFormatValue)) {
231 return []
232 }
233
234 // Filter valid fields
235 return inputFormatValue.filter(
236 (field): field is InputFormatField =>
237 field &&
238 typeof field === 'object' &&
239 typeof field.name === 'string' &&
240 field.name.trim() !== ''
241 )
242}

Callers 11

buildTriggerRunOptionFunction · 0.90
getUnifiedStartOutputsFunction · 0.90
getLegacyStarterOutputsFunction · 0.90
getBlockOutputsFunction · 0.90
WorkflowSidebarBodyFunction · 0.90
ApiInfoModalFunction · 0.90
ChatFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected