MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / safeJsonParse

Function safeJsonParse

packages/cli/src/utils/triggerApi.ts:231–241  ·  view source on GitHub ↗
(raw: string | null | undefined)

Source from the content-addressed store, hash-verified

229}
230
231function safeJsonParse(raw: string | null | undefined): unknown {
232 if (typeof raw !== "string") {
233 return;
234 }
235
236 try {
237 return JSON.parse(raw);
238 } catch (error) {
239 return;
240 }
241}

Callers 1

registerEndpointMethod · 0.70

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…