MCPcopy
hub / github.com/YMFE/yapi / json_parse

Function json_parse

common/markdown.js:4–10  ·  view source on GitHub ↗
(json)

Source from the content-addressed store, hash-verified

2const _ = require('underscore');
3
4const json_parse = function(json) {
5 try {
6 return JSON.parse(json);
7 } catch (err) {
8 return {};
9 }
10};
11// 处理字符串换行
12const handleWrap = str => {
13 return _.isString(str) ? str.replace(/\n/gi, '<br/>') : str;

Callers 8

transformJsonToSchemaFunction · 0.90
transformJsonToSchemaFunction · 0.90
handleParamsFunction · 0.85
crossRequestFunction · 0.85
handleParamsFunction · 0.85
createSchemaTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected