MCPcopy Create free account
hub / github.com/Semporia/Scripts / safeGet

Function safeGet

activity/jd_split.js:289–299  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

287 })
288}
289function safeGet(data) {
290 try {
291 if (typeof JSON.parse(data) == "object") {
292 return true;
293 }
294 } catch (e) {
295 console.log(e);
296 console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
297 return false;
298 }
299}
300function jsonParse(str) {
301 if (typeof str == "string") {
302 try {

Callers 3

jdsplit_collectScoreFunction · 0.70
jdsplit_getLotteryFunction · 0.70
jdsplit_getTaskDetailFunction · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected