MCPcopy Create free account
hub / github.com/SensAI-PT/RAGMeUp / safeParseJSON

Function safeParseJSON

ui/node-react/client/src/components/FeedbackPage.js:40–48  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

38 const negativeCount = feedbackItems.filter((f) => f.feedback === false).length;
39
40 function safeParseJSON(str) {
41 if (!str) return [];
42 if (typeof str === 'object') return str;
43 try {
44 return JSON.parse(str);
45 } catch {
46 return [];
47 }
48 }
49
50 const toggleDocs = (idx) => {
51 setExpandedDocs((prev) => ({ ...prev, [idx]: !prev[idx] }));

Callers 1

FeedbackPage.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected