MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / isJSONString

Method isJSONString

wxapp/miaoyouHome.js:310–321  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

308 .join('&');
309 }
310 isJSONString(str) {
311 try {
312 var obj = JSON.parse(str);
313 if (typeof obj == 'object' && obj) {
314 return true;
315 } else {
316 return false;
317 }
318 } catch (e) {
319 return false;
320 }
321 }
322 isJson(obj) {
323 var isjson = typeof (obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length;
324 return isjson;

Callers 1

httpRequestMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected