MCPcopy
hub / github.com/triggerdotdev/trigger.dev / safeJsonParse

Function safeJsonParse

packages/cli-v3/src/utilities/safeJsonParse.ts:1–11  ·  view source on GitHub ↗
(json?: string)

Source from the content-addressed store, hash-verified

1export function safeJsonParse(json?: string): unknown {
2 if (!json) {
3 return undefined;
4 }
5
6 try {
7 return JSON.parse(json);
8 } catch {
9 return undefined;
10 }
11}

Callers 1

_deployCommandFunction · 0.90

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…