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

Function safeGet

activity/jd_watch.js:393–403  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

391 })
392}
393function safeGet(data) {
394 try {
395 if (typeof JSON.parse(data) == "object") {
396 return true;
397 }
398 } catch (e) {
399 console.log(e);
400 console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
401 return false;
402 }
403}
404function jsonParse(str) {
405 if (typeof str == "string") {
406 try {

Callers 4

getTaskListFunction · 0.70
acceptTaskFunction · 0.70
doTaskFunction · 0.70
rewardFunction · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected