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

Function safeGet

activity/jd_ds.js:189–199  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

187 })
188}
189function safeGet(data) {
190 try {
191 if (typeof JSON.parse(data) == "object") {
192 return true;
193 }
194 } catch (e) {
195 console.log(e);
196 console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
197 return false;
198 }
199}
200function jsonParse(str) {
201 if (typeof str == "string") {
202 try {

Callers 1

userSignInFunction · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected