MCPcopy
hub / github.com/xcanwin/KeepChatGPT / parseJsonSafely

Function parseJsonSafely

KeepChatGPT.user.js:2125–2131  ·  view source on GitHub ↗
(text, fallback = null)

Source from the content-addressed store, hash-verified

2123 };
2124
2125 const parseJsonSafely = function (text, fallback = null) {
2126 try {
2127 return JSON.parse(text);
2128 } catch (e) {
2129 return fallback;
2130 }
2131 };
2132
2133 const rebuildConsumedResponse = function (response, body) {
2134 return new Response(body, {

Callers 2

hookFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected