MCPcopy Create free account
hub / github.com/ModelEngine-Group/app-platform / isJsonString

Function isJsonString

frontend/src/shared/utils/common.ts:184–193  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

182* @return {boolean} 如果是合法的JSON字符串,返回true,否则返回false
183*/
184export const isJsonString = (str) => {
185 try {
186 if (typeof JSON.parse(str) === 'object') {
187 return true;
188 }
189 } catch (e) {
190 return false;
191 }
192 return false;
193}
194
195/**
196* 将文本中的URL转换为链接的HTML格式

Callers 4

chatStrInitFunction · 0.90
historyChatProcessFunction · 0.90
reportProcessFunction · 0.90
messageProcessNormalFunction · 0.90

Calls 1

parseMethod · 0.65

Tested by

no test coverage detected