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

Function sanitizeConditions

apps/sim/lib/workflows/sanitization/json-sanitizer.ts:149–161  ·  view source on GitHub ↗

* Sanitize condition blocks by removing UI-specific metadata * Returns cleaned JSON string (not parsed array)

(conditionsJson: string)

Source from the content-addressed store, hash-verified

147 * Returns cleaned JSON string (not parsed array)
148 */
149function sanitizeConditions(conditionsJson: string): string {
150 try {
151 const conditions: unknown = JSON.parse(conditionsJson)
152 if (!Array.isArray(conditions)) return conditionsJson
153
154 // Keep only id, title, and value - remove UI state
155 const cleaned: SanitizedCondition[] = conditions.map(toSanitizedCondition)
156
157 return JSON.stringify(cleaned)
158 } catch {
159 return conditionsJson
160 }
161}
162
163/** Tool input structure for sanitization */
164interface ToolInput {

Callers 1

sanitizeSubBlocksFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected