MCPcopy Create free account
hub / github.com/TruthHun/BookStack / formatNonError

Function formatNonError

static/word2md/mammoth.browser.js:5278–5302  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

5276}
5277
5278function formatNonError(obj) {
5279 var str;
5280 if (typeof obj === "function") {
5281 str = "[function " +
5282 (obj.name || "anonymous") +
5283 "]";
5284 } else {
5285 str = obj && typeof obj.toString === "function"
5286 ? obj.toString() : util.toString(obj);
5287 var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/;
5288 if (ruselessToString.test(str)) {
5289 try {
5290 var newStr = JSON.stringify(obj);
5291 str = newStr;
5292 }
5293 catch(e) {
5294
5295 }
5296 }
5297 if (str.length === 0) {
5298 str = "(empty array)";
5299 }
5300 }
5301 return ("(<" + snip(str) + ">, no stack trace)");
5302}
5303
5304function snip(str) {
5305 var maxChars = 41;

Callers 2

v8stackFormatterFunction · 0.70
mammoth.browser.jsFile · 0.70

Calls 1

snipFunction · 0.70

Tested by

no test coverage detected