MCPcopy Create free account
hub / github.com/openai/openai-node / safeJSON

Function safeJSON

src/internal/utils/values.ts:99–105  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

97};
98
99export const safeJSON = (text: string) => {
100 try {
101 return JSON.parse(text);
102 } catch (err) {
103 return undefined;
104 }
105};

Callers 1

makeRequestMethod · 0.90

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected