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

Function isJson5

client/common.js:37–47  ·  view source on GitHub ↗
(json)

Source from the content-addressed store, hash-verified

35exports.isJson = isJson;
36
37function isJson5(json) {
38 if (!json) {
39 return false;
40 }
41 try {
42 json = json5.parse(json);
43 return json;
44 } catch (e) {
45 return false;
46 }
47}
48exports.safeArray = function(arr) {
49 return Array.isArray(arr) ? arr : [];
50};

Callers 2

handleParamsFunction · 0.85
handleParamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected