organism-react-ajax
Advanced tools
Comparing version 0.16.9 to 0.17.0
@@ -86,2 +86,24 @@ "use strict"; | ||
dlog.prototype.show = function (level, data) { | ||
var jsonParse = function jsonParse(s) { | ||
if ("string" === typeof s) { | ||
try { | ||
return JSON.parse(s, function (k, v) { | ||
if (v && typeof v === "object" && !Array.isArray(v)) { | ||
var nextObj = Object.create(null); | ||
Object.keys(v).forEach(function (k) { | ||
nextObj[k] = v[k]; | ||
}); | ||
return nextObj; | ||
} | ||
return v; | ||
}); | ||
} catch (e) { | ||
return s; | ||
} | ||
} else { | ||
return s; | ||
} | ||
}; | ||
console.info("%c [%s] %c %s %c %s:", this.getCSS(), new Date().toJSON(), this.getCSS("name"), this.name, this.getCSS(level), level.toUpperCase()); | ||
@@ -99,2 +121,4 @@ | ||
data = jsonParse(data); | ||
if (Array.isArray(data[0]) && this.isAllObj(data[0])) { | ||
@@ -101,0 +125,0 @@ console.table(data[0]); |
@@ -81,2 +81,24 @@ // dlog 0.1.1 | ||
dlog.prototype.show = function (level, data) { | ||
var jsonParse = function jsonParse(s) { | ||
if ("string" === typeof s) { | ||
try { | ||
return JSON.parse(s, function (k, v) { | ||
if (v && typeof v === "object" && !Array.isArray(v)) { | ||
var nextObj = Object.create(null); | ||
Object.keys(v).forEach(function (k) { | ||
nextObj[k] = v[k]; | ||
}); | ||
return nextObj; | ||
} | ||
return v; | ||
}); | ||
} catch (e) { | ||
return s; | ||
} | ||
} else { | ||
return s; | ||
} | ||
}; | ||
console.info("%c [%s] %c %s %c %s:", this.getCSS(), new Date().toJSON(), this.getCSS("name"), this.name, this.getCSS(level), level.toUpperCase()); | ||
@@ -94,2 +116,4 @@ | ||
data = jsonParse(data); | ||
if (Array.isArray(data[0]) && this.isAllObj(data[0])) { | ||
@@ -96,0 +120,0 @@ console.table(data[0]); |
{ | ||
"version": "0.16.9", | ||
"version": "0.17.0", | ||
"name": "organism-react-ajax", | ||
@@ -4,0 +4,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80329
2469