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

Function normalizeDependencyValue

apps/sim/lib/workflows/subblocks/visibility.ts:64–81  ·  view source on GitHub ↗
(rawValue: unknown)

Source from the content-addressed store, hash-verified

62}
63
64export function normalizeDependencyValue(rawValue: unknown): unknown {
65 if (rawValue === null || rawValue === undefined) return null
66
67 if (typeof rawValue === 'object') {
68 if (Array.isArray(rawValue)) {
69 if (rawValue.length === 0) return null
70 return rawValue.map((item) => normalizeDependencyValue(item))
71 }
72
73 const record = rawValue as Record<string, unknown>
74 if ('value' in record) return normalizeDependencyValue(record.value)
75 if ('id' in record) return record.id
76
77 return record
78 }
79
80 return rawValue
81}
82
83/**
84 * Build a flat map of subblock values keyed by subblock id.

Callers 3

buildSelectorContextFunction · 0.90
useDependsOnGateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected