MCPcopy Create free account
hub / github.com/simstudioai/sim / safeJsonParse

Function safeJsonParse

apps/sim/lib/logs/execution/progress-markers.ts:151–158  ·  view source on GitHub ↗
(raw: string | undefined)

Source from the content-addressed store, hash-verified

149}
150
151function safeJsonParse(raw: string | undefined): unknown {
152 if (!raw) return undefined
153 try {
154 return JSON.parse(raw)
155 } catch {
156 return undefined
157 }
158}
159
160function isRecord(value: unknown): value is Record<string, unknown> {
161 return typeof value === 'object' && value !== null && !Array.isArray(value)

Callers 2

parseStartedMarkerFunction · 0.85
parseCompletedMarkerFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected