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

Function safeGet

jd_fruit.js:1426–1436  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

1424 })
1425}
1426function safeGet(data) {
1427 try {
1428 if (typeof JSON.parse(data) == "object") {
1429 return true;
1430 }
1431 } catch (e) {
1432 console.log(e);
1433 console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
1434 return false;
1435 }
1436}
1437function taskUrl(function_id, body = {}) {
1438 return {
1439 url: `${JD_API_HOST}?functionId=${function_id}&appid=wh5&body=${escape(JSON.stringify(body))}`,

Callers 3

getFullCollectionRewardFunction · 0.70
initForFarmFunction · 0.70
requestFunction · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected