MCPcopy Create free account
hub / github.com/MiroMindAI/MiroThinker / isJsonString

Function isJsonString

apps/visualize-trace/static/js/script.js:231–243  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

229
230// 增强的内容渲染函数
231function isJsonString(str) {
232 try {
233 const trimmed = str.trim();
234 if ((trimmed.startsWith('{') && trimmed.endsWith('}')) ||
235 (trimmed.startsWith('[') && trimmed.endsWith(']'))) {
236 JSON.parse(trimmed);
237 return true;
238 }
239 return false;
240 } catch (e) {
241 return false;
242 }
243}
244
245function formatJsonContent(content) {
246 try {

Callers 1

renderContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected