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

Function parseOutputContentSafely

apps/sim/lib/core/utils/response-format.ts:150–165  ·  view source on GitHub ↗
(output: any)

Source from the content-addressed store, hash-verified

148 * Handles both string and object formats with proper error handling
149 */
150export function parseOutputContentSafely(output: any): any {
151 if (!output?.content) {
152 return output
153 }
154
155 if (typeof output.content === 'string') {
156 try {
157 return JSON.parse(output.content)
158 } catch (e) {
159 // Fallback to original structure if parsing fails
160 return output
161 }
162 }
163
164 return output
165}
166
167/**
168 * Check if a set of output IDs contains response format selections for a specific block

Callers 3

extractOutputValueFunction · 0.90
extractOutputFromLogsFunction · 0.90
traverseObjectPathFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected