jsonify-error
Advanced tools
Comparing version 1.4.5 to 2.0.0
@@ -9,2 +9,8 @@ # Changelog | ||
## [2.0.0] - 2019-07-27 | ||
### Changed | ||
- Strip color control characters from strings ([#8](https://github.com/papb/jsonify-error/issues/8)) | ||
_**Note:** This was marked as a breaking change just to be safe. Someone might be doing tests comparing the output of jsonifyError directly, and something could break. But I guess 99.999% of the users can just upgrade._ | ||
## [1.4.5] - 2019-04-28 | ||
@@ -95,15 +101,16 @@ ### Fixed | ||
[Unreleased]: https://github.com/papb/jsonify-error/compare/v1.4.5...HEAD | ||
[1.4.5]: https://github.com/papb/jsonify-error/compare/v1.4.4...v1.4.5 | ||
[1.4.4]: https://github.com/papb/jsonify-error/compare/v1.4.3...v1.4.4 | ||
[1.4.3]: https://github.com/papb/jsonify-error/compare/v1.4.2...v1.4.3 | ||
[1.4.2]: https://github.com/papb/jsonify-error/compare/v1.4.1...v1.4.2 | ||
[1.4.1]: https://github.com/papb/jsonify-error/compare/v1.4.0...v1.4.1 | ||
[1.4.0]: https://github.com/papb/jsonify-error/compare/v1.3.1...v1.4.0 | ||
[1.3.1]: https://github.com/papb/jsonify-error/compare/v1.3.0...v1.3.1 | ||
[1.3.0]: https://github.com/papb/jsonify-error/compare/v1.2.2...v1.3.0 | ||
[1.2.2]: https://github.com/papb/jsonify-error/compare/v1.2.1...v1.2.2 | ||
[1.2.1]: https://github.com/papb/jsonify-error/compare/v1.2.0...v1.2.1 | ||
[1.2.0]: https://github.com/papb/jsonify-error/compare/v1.1.2...v1.2.0 | ||
[1.1.2]: https://github.com/papb/jsonify-error/compare/v1.1.1...v1.1.2 | ||
[1.1.1]: https://github.com/papb/jsonify-error/compare/v1.0.0...v1.1.1 | ||
[Unreleased]: https://github.com/papb/jsonify-error/compare/2.0.0...HEAD | ||
[2.0.0]: https://github.com/papb/jsonify-error/compare/1.4.5...2.0.0 | ||
[1.4.5]: https://github.com/papb/jsonify-error/compare/1.4.4...1.4.5 | ||
[1.4.4]: https://github.com/papb/jsonify-error/compare/1.4.3...1.4.4 | ||
[1.4.3]: https://github.com/papb/jsonify-error/compare/1.4.2...1.4.3 | ||
[1.4.2]: https://github.com/papb/jsonify-error/compare/1.4.1...1.4.2 | ||
[1.4.1]: https://github.com/papb/jsonify-error/compare/1.4.0...1.4.1 | ||
[1.4.0]: https://github.com/papb/jsonify-error/compare/1.3.1...1.4.0 | ||
[1.3.1]: https://github.com/papb/jsonify-error/compare/1.3.0...1.3.1 | ||
[1.3.0]: https://github.com/papb/jsonify-error/compare/1.2.2...1.3.0 | ||
[1.2.2]: https://github.com/papb/jsonify-error/compare/1.2.1...1.2.2 | ||
[1.2.1]: https://github.com/papb/jsonify-error/compare/1.2.0...1.2.1 | ||
[1.2.0]: https://github.com/papb/jsonify-error/compare/1.1.2...1.2.0 | ||
[1.1.2]: https://github.com/papb/jsonify-error/compare/1.1.1...1.1.2 | ||
[1.1.1]: https://github.com/papb/jsonify-error/compare/1.0.0...1.1.1 |
@@ -21,3 +21,3 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":9}],3:[function(require,module,exports){ | ||
},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":10}],3:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -62,2 +62,4 @@ | ||
var stripColorsIfString = require("./strip-colors-if-string"); | ||
module.exports = function jsonifyError(error) { | ||
@@ -68,3 +70,3 @@ if (!(error instanceof Error)) return error; | ||
wrappedError.className = error.constructor.name || "<no class name available>"; | ||
wrappedError.message = error.message || "<no message available>"; | ||
wrappedError.message = stripColorsIfString(error.message) || "<no message available>"; | ||
wrappedError.superclasses = getSuperclasses(error); | ||
@@ -74,3 +76,3 @@ wrappedError.enumerableFields = {}; | ||
if (typeof error[x] === "function") continue; | ||
wrappedError.enumerableFields[x] = error[x]; | ||
wrappedError.enumerableFields[x] = stripColorsIfString(error[x]); | ||
} | ||
@@ -82,5 +84,5 @@ if (typeof error.stack === "string" && error.stack.length > 0) { | ||
return x; | ||
}); | ||
}).map(stripColorsIfString); | ||
} else { | ||
wrappedError.stack = error.stack || "<no stack trace available>"; | ||
wrappedError.stack = stripColorsIfString(error.stack) || "<no stack trace available>"; | ||
} | ||
@@ -90,3 +92,3 @@ return wrappedError; | ||
},{"./get-superclasses":5}],7:[function(require,module,exports){ | ||
},{"./get-superclasses":5,"./strip-colors-if-string":9}],7:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -181,5 +183,16 @@ | ||
},{"./jsonify-error":6,"./to-string":9}],9:[function(require,module,exports){ | ||
},{"./jsonify-error":6,"./to-string":10}],9:[function(require,module,exports){ | ||
"use strict"; | ||
function stripColorsIfString(arg) { | ||
if (typeof arg !== "string") return arg; | ||
/* eslint-disable-next-line no-control-regex */ | ||
return arg.replace(/\u001b\[\d{1,2}m/g, "").replace(/\\u001b\[\d{1,2}m/g, ""); | ||
} | ||
module.exports = stripColorsIfString; | ||
},{}],10:[function(require,module,exports){ | ||
"use strict"; | ||
var stringify = require("json-stringify-safe"); | ||
@@ -207,3 +220,3 @@ var jsonifyError = require("./jsonify-error"); | ||
},{"./jsonify-error":6,"json-stringify-safe":10}],10:[function(require,module,exports){ | ||
},{"./jsonify-error":6,"json-stringify-safe":11}],11:[function(require,module,exports){ | ||
exports = module.exports = stringify | ||
@@ -238,2 +251,2 @@ exports.getSerialize = serializer | ||
},{}]},{},[1]) | ||
//# sourceMappingURL=data:application/json;charset=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Nlcikge1xuICB2YXIgc3RhY2sgPSBbXSwga2V5cyA9IFtdXG5cbiAgaWYgKGN5Y2xlUmVwbGFjZXIgPT0gbnVsbCkgY3ljbGVSZXBsYWNlciA9IGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICBpZiAoc3RhY2tbMF0gPT09IHZhbHVlKSByZXR1cm4gXCJbQ2lyY3VsYXIgfl1cIlxuICAgIHJldHVybiBcIltDaXJjdWxhciB+LlwiICsga2V5cy5zbGljZSgwLCBzdGFjay5pbmRleE9mKHZhbHVlKSkuam9pbihcIi5cIikgKyBcIl1cIlxuICB9XG5cbiAgcmV0dXJuIGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICBpZiAoc3RhY2subGVuZ3RoID4gMCkge1xuICAgICAgdmFyIHRoaXNQb3MgPSBzdGFjay5pbmRleE9mKHRoaXMpXG4gICAgICB+dGhpc1BvcyA/IHN0YWNrLnNwbGljZSh0aGlzUG9zICsgMSkgOiBzdGFjay5wdXNoKHRoaXMpXG4gICAgICB+dGhpc1BvcyA/IGtleXMuc3BsaWNlKHRoaXNQb3MsIEluZmluaXR5LCBrZXkpIDoga2V5cy5wdXNoKGtleSlcbiAgICAgIGlmICh+c3RhY2suaW5kZXhPZih2YWx1ZSkpIHZhbHVlID0gY3ljbGVSZXBsYWNlci5jYWxsKHRoaXMsIGtleSwgdmFsdWUpXG4gICAgfVxuICAgIGVsc2Ugc3RhY2sucHVzaCh2YWx1ZSlcblxuICAgIHJldHVybiByZXBsYWNlciA9PSBudWxsID8gdmFsdWUgOiByZXBsYWNlci5jYWxsKHRoaXMsIGtleSwgdmFsdWUpXG4gIH1cbn1cbiJdfQ== |
@@ -1,1 +0,1 @@ | ||
!function(){return function r(e,n,t){function o(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};e[s][0].call(f.exports,function(r){return o(e[s][1][r]||r)},f,f.exports,r,e,n,t)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<t.length;s++)o(t[s]);return o}}()({1:[function(r,e,n){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,e,n){"use strict";var t=r("./lib/jsonify-error"),o=r("./lib/override-console"),i=r("./lib/override-error-methods"),s=r("./lib/log"),a=r("./lib/to-string");e.exports=t,e.exports.overrideConsole=o,e.exports.overrideErrorMethods=i,e.exports.log=s,e.exports.asString=a},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":9}],3:[function(r,e,n){"use strict";var t=r("./../map-arg");e.exports=function(r){console.error(t(r))}},{"./../map-arg":4}],4:[function(r,e,n){"use strict";var t=r("./../jsonify-error");e.exports=function(r){return r instanceof Error?t(r):r}},{"./../jsonify-error":6}],5:[function(r,e,n){"use strict";e.exports=function(r){var e=[],n=Object.getPrototypeOf(r);for(null!==n&&(n=Object.getPrototypeOf(n));null!==n;)e.push(n.constructor.name),n=Object.getPrototypeOf(n);return e}},{}],6:[function(r,e,n){"use strict";var t=r("./get-superclasses");e.exports=function(r){if(!(r instanceof Error))return r;var e={};for(var n in e.name=r.name||"<no name available>",e.className=r.constructor.name||"<no class name available>",e.message=r.message||"<no message available>",e.superclasses=t(r),e.enumerableFields={},r)"function"!=typeof r[n]&&(e.enumerableFields[n]=r[n]);return"string"==typeof r.stack&&r.stack.length>0?e.stack=r.stack.split("\n").map(function(r){return r.replace(/^\s+/,"")}).filter(function(r){return r}):e.stack=r.stack||"<no stack trace available>",e}},{"./get-superclasses":5}],7:[function(r,e,n){"use strict";var t=r("./map-arg"),o=["log","debug","info","warn","error"],i=!1;e.exports=function(){if(!i){i=!0;var r={},e=function(e){if(!console[e])return"continue";r[e]=console[e].bind(console),console[e]=function(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];r[e].apply(r,function(r){if(Array.isArray(r)){for(var e=0,n=Array(r.length);e<r.length;e++)n[e]=r[e];return n}return Array.from(r)}(o.map(t)))}},n=!0,s=!1,a=void 0;try{for(var u,c=o[Symbol.iterator]();!(n=(u=c.next()).done);n=!0)e(u.value)}catch(r){s=!0,a=r}finally{try{!n&&c.return&&c.return()}finally{if(s)throw a}}}}},{"./map-arg":4}],8:[function(r,e,n){"use strict";var t=r("./jsonify-error"),o=r("./to-string");e.exports=function(){Error.prototype.toJSON=function(){return t(this)},Error.prototype.toString=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return o(this,r)}}},{"./jsonify-error":6,"./to-string":9}],9:[function(r,e,n){"use strict";var t=r("json-stringify-safe"),o=r("./jsonify-error");e.exports=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(r instanceof Error))throw new TypeError("jsonifyError.toString() error: First argument must be instance of Error.");var n=o(r);return n.className+": "+n.message+" "+t(n,null,e)}},{"./jsonify-error":6,"json-stringify-safe":10}],10:[function(r,e,n){function t(r,e){var n=[],t=[];return null==e&&(e=function(r,e){return n[0]===e?"[Circular ~]":"[Circular ~."+t.slice(0,n.indexOf(e)).join(".")+"]"}),function(o,i){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?t.splice(s,1/0,o):t.push(o),~n.indexOf(i)&&(i=e.call(this,o,i))}else n.push(i);return null==r?i:r.call(this,o,i)}}(e.exports=function(r,e,n,o){return JSON.stringify(r,t(e,o),n)}).getSerialize=t},{}]},{},[1]); | ||
!function(){return function r(e,t,n){function o(s,a){if(!t[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=t[s]={exports:{}};e[s][0].call(f.exports,function(r){return o(e[s][1][r]||r)},f,f.exports,r,e,t,n)}return t[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}}()({1:[function(r,e,t){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,e,t){"use strict";var n=r("./lib/jsonify-error"),o=r("./lib/override-console"),i=r("./lib/override-error-methods"),s=r("./lib/log"),a=r("./lib/to-string");e.exports=n,e.exports.overrideConsole=o,e.exports.overrideErrorMethods=i,e.exports.log=s,e.exports.asString=a},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":10}],3:[function(r,e,t){"use strict";var n=r("./../map-arg");e.exports=function(r){console.error(n(r))}},{"./../map-arg":4}],4:[function(r,e,t){"use strict";var n=r("./../jsonify-error");e.exports=function(r){return r instanceof Error?n(r):r}},{"./../jsonify-error":6}],5:[function(r,e,t){"use strict";e.exports=function(r){var e=[],t=Object.getPrototypeOf(r);for(null!==t&&(t=Object.getPrototypeOf(t));null!==t;)e.push(t.constructor.name),t=Object.getPrototypeOf(t);return e}},{}],6:[function(r,e,t){"use strict";var n=r("./get-superclasses"),o=r("./strip-colors-if-string");e.exports=function(r){if(!(r instanceof Error))return r;var e={};for(var t in e.name=r.name||"<no name available>",e.className=r.constructor.name||"<no class name available>",e.message=o(r.message)||"<no message available>",e.superclasses=n(r),e.enumerableFields={},r)"function"!=typeof r[t]&&(e.enumerableFields[t]=o(r[t]));return"string"==typeof r.stack&&r.stack.length>0?e.stack=r.stack.split("\n").map(function(r){return r.replace(/^\s+/,"")}).filter(function(r){return r}).map(o):e.stack=o(r.stack)||"<no stack trace available>",e}},{"./get-superclasses":5,"./strip-colors-if-string":9}],7:[function(r,e,t){"use strict";var n=r("./map-arg"),o=["log","debug","info","warn","error"],i=!1;e.exports=function(){if(!i){i=!0;var r={},e=function(e){if(!console[e])return"continue";r[e]=console[e].bind(console),console[e]=function(){for(var t=arguments.length,o=Array(t),i=0;i<t;i++)o[i]=arguments[i];r[e].apply(r,function(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}return Array.from(r)}(o.map(n)))}},t=!0,s=!1,a=void 0;try{for(var u,c=o[Symbol.iterator]();!(t=(u=c.next()).done);t=!0)e(u.value)}catch(r){s=!0,a=r}finally{try{!t&&c.return&&c.return()}finally{if(s)throw a}}}}},{"./map-arg":4}],8:[function(r,e,t){"use strict";var n=r("./jsonify-error"),o=r("./to-string");e.exports=function(){Error.prototype.toJSON=function(){return n(this)},Error.prototype.toString=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return o(this,r)}}},{"./jsonify-error":6,"./to-string":10}],9:[function(r,e,t){"use strict";e.exports=function(r){return"string"!=typeof r?r:r.replace(/\u001b\[\d{1,2}m/g,"").replace(/\\u001b\[\d{1,2}m/g,"")}},{}],10:[function(r,e,t){"use strict";var n=r("json-stringify-safe"),o=r("./jsonify-error");e.exports=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(r instanceof Error))throw new TypeError("jsonifyError.toString() error: First argument must be instance of Error.");var t=o(r);return t.className+": "+t.message+" "+n(t,null,e)}},{"./jsonify-error":6,"json-stringify-safe":11}],11:[function(r,e,t){function n(r,e){var t=[],n=[];return null==e&&(e=function(r,e){return t[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,t.indexOf(e)).join(".")+"]"}),function(o,i){if(t.length>0){var s=t.indexOf(this);~s?t.splice(s+1):t.push(this),~s?n.splice(s,1/0,o):n.push(o),~t.indexOf(i)&&(i=e.call(this,o,i))}else t.push(i);return null==r?i:r.call(this,o,i)}}(e.exports=function(r,e,t,o){return JSON.stringify(r,n(e,o),t)}).getSerialize=n},{}]},{},[1]); |
@@ -18,3 +18,3 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
module.exports.asString = toString; | ||
},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":9}],3:[function(require,module,exports){ | ||
},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":10}],3:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -56,2 +56,4 @@ | ||
const stripColorsIfString = require("./strip-colors-if-string"); | ||
module.exports = function jsonifyError(error) { | ||
@@ -62,3 +64,3 @@ if (!(error instanceof Error)) return error; | ||
wrappedError.className = error.constructor.name || "<no class name available>"; | ||
wrappedError.message = error.message || "<no message available>"; | ||
wrappedError.message = stripColorsIfString(error.message) || "<no message available>"; | ||
wrappedError.superclasses = getSuperclasses(error); | ||
@@ -68,12 +70,12 @@ wrappedError.enumerableFields = {}; | ||
if (typeof error[x] === "function") continue; | ||
wrappedError.enumerableFields[x] = error[x]; | ||
wrappedError.enumerableFields[x] = stripColorsIfString(error[x]); | ||
} | ||
if (typeof error.stack === "string" && error.stack.length > 0) { | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")).filter(x => x); | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")).filter(x => x).map(stripColorsIfString); | ||
} else { | ||
wrappedError.stack = error.stack || "<no stack trace available>"; | ||
wrappedError.stack = stripColorsIfString(error.stack) || "<no stack trace available>"; | ||
} | ||
return wrappedError; | ||
}; | ||
},{"./get-superclasses":5}],7:[function(require,module,exports){ | ||
},{"./get-superclasses":5,"./strip-colors-if-string":9}],7:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -132,5 +134,15 @@ | ||
}; | ||
},{"./jsonify-error":6,"./to-string":9}],9:[function(require,module,exports){ | ||
},{"./jsonify-error":6,"./to-string":10}],9:[function(require,module,exports){ | ||
"use strict"; | ||
function stripColorsIfString(arg) { | ||
if (typeof arg !=="string") return arg; | ||
/* eslint-disable-next-line no-control-regex */ | ||
return arg.replace(/\u001b\[\d{1,2}m/g, "").replace(/\\u001b\[\d{1,2}m/g, ""); | ||
} | ||
module.exports = stripColorsIfString; | ||
},{}],10:[function(require,module,exports){ | ||
"use strict"; | ||
const stringify = require("json-stringify-safe"); | ||
@@ -156,3 +168,3 @@ const jsonifyError = require("./jsonify-error"); | ||
},{"./jsonify-error":6,"json-stringify-safe":10}],10:[function(require,module,exports){ | ||
},{"./jsonify-error":6,"json-stringify-safe":11}],11:[function(require,module,exports){ | ||
exports = module.exports = stringify | ||
@@ -187,2 +199,2 @@ exports.getSerialize = serializer | ||
},{}]},{},[1]) | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJicm93c2VyLWVudHJ5cG9pbnQuanMiLCJpbmRleC5qcyIsImxpYi9icm93c2VyLXNwZWNpZmljL2xvZy5qcyIsImxpYi9icm93c2VyLXNwZWNpZmljL21hcC1hcmcuanMiLCJsaWIvZ2V0LXN1cGVyY2xhc3Nlcy5qcyIsImxpYi9qc29uaWZ5LWVycm9yLmpzIiwibGliL292ZXJyaWRlLWNvbnNvbGUuanMiLCJsaWIvb3ZlcnJpZGUtZXJyb3ItbWV0aG9kcy5qcyIsImxpYi90by1zdHJpbmcuanMiLCJub2RlX21vZHVsZXMvanNvbi1zdHJpbmdpZnktc2FmZS9zdHJpbmdpZnkuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUNBQTtBQUNBOztBQ0RBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQ1pBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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5cy5zbGljZSgwLCBzdGFjay5pbmRleE9mKHZhbHVlKSkuam9pbihcIi5cIikgKyBcIl1cIlxuICB9XG5cbiAgcmV0dXJuIGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICBpZiAoc3RhY2subGVuZ3RoID4gMCkge1xuICAgICAgdmFyIHRoaXNQb3MgPSBzdGFjay5pbmRleE9mKHRoaXMpXG4gICAgICB+dGhpc1BvcyA/IHN0YWNrLnNwbGljZSh0aGlzUG9zICsgMSkgOiBzdGFjay5wdXNoKHRoaXMpXG4gICAgICB+dGhpc1BvcyA/IGtleXMuc3BsaWNlKHRoaXNQb3MsIEluZmluaXR5LCBrZXkpIDoga2V5cy5wdXNoKGtleSlcbiAgICAgIGlmICh+c3RhY2suaW5kZXhPZih2YWx1ZSkpIHZhbHVlID0gY3ljbGVSZXBsYWNlci5jYWxsKHRoaXMsIGtleSwgdmFsdWUpXG4gICAgfVxuICAgIGVsc2Ugc3RhY2sucHVzaCh2YWx1ZSlcblxuICAgIHJldHVybiByZXBsYWNlciA9PSBudWxsID8gdmFsdWUgOiByZXBsYWNlci5jYWxsKHRoaXMsIGtleSwgdmFsdWUpXG4gIH1cbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJicm93c2VyLWVudHJ5cG9pbnQuanMiLCJpbmRleC5qcyIsImxpYi9icm93c2VyLXNwZWNpZmljL2xvZy5qcyIsImxpYi9icm93c2VyLXNwZWNpZmljL21hcC1hcmcuanMiLCJsaWIvZ2V0LXN1cGVyY2xhc3Nlcy5qcyIsImxpYi9qc29uaWZ5LWVycm9yLmpzIiwibGliL292ZXJyaWRlLWNvbnNvbGUuanMiLCJsaWIvb3ZlcnJpZGUtZXJyb3ItbWV0aG9kcy5qcyIsImxpYi9zdHJpcC1jb2xvcnMtaWYtc3Ry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9pbihcIi5cIikgKyBcIl1cIlxuICB9XG5cbiAgcmV0dXJuIGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICBpZiAoc3RhY2subGVuZ3RoID4gMCkge1xuICAgICAgdmFyIHRoaXNQb3MgPSBzdGFjay5pbmRleE9mKHRoaXMpXG4gICAgICB+dGhpc1BvcyA/IHN0YWNrLnNwbGljZSh0aGlzUG9zICsgMSkgOiBzdGFjay5wdXNoKHRoaXMpXG4gICAgICB+dGhpc1BvcyA/IGtleXMuc3BsaWNlKHRoaXNQb3MsIEluZmluaXR5LCBrZXkpIDoga2V5cy5wdXNoKGtleSlcbiAgICAgIGlmICh+c3RhY2suaW5kZXhPZih2YWx1ZSkpIHZhbHVlID0gY3ljbGVSZXBsYWNlci5jYWxsKHRoaXMsIGtleSwgdmFsdWUpXG4gICAgfVxuICAgIGVsc2Ugc3RhY2sucHVzaCh2YWx1ZSlcblxuICAgIHJldHVybiByZXBsYWNlciA9PSBudWxsID8gdmFsdWUgOiByZXBsYWNlci5jYWxsKHRoaXMsIGtleSwgdmFsdWUpXG4gIH1cbn1cbiJdfQ== |
@@ -1,1 +0,1 @@ | ||
!function(){return function r(t,e,n){function o(i,c){if(!e[i]){if(!t[i]){var u="function"==typeof require&&require;if(!c&&u)return u(i,!0);if(s)return s(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var a=e[i]={exports:{}};t[i][0].call(a.exports,function(r){return o(t[i][1][r]||r)},a,a.exports,r,t,e,n)}return e[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}}()({1:[function(r,t,e){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,t,e){"use strict";const n=r("./lib/jsonify-error"),o=r("./lib/override-console"),s=r("./lib/override-error-methods"),i=r("./lib/log"),c=r("./lib/to-string");t.exports=n,t.exports.overrideConsole=o,t.exports.overrideErrorMethods=s,t.exports.log=i,t.exports.asString=c},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":9}],3:[function(r,t,e){"use strict";const n=r("./../map-arg");t.exports=function(r){console.error(n(r))}},{"./../map-arg":4}],4:[function(r,t,e){"use strict";const n=r("./../jsonify-error");t.exports=function(r){return r instanceof Error?n(r):r}},{"./../jsonify-error":6}],5:[function(r,t,e){"use strict";t.exports=function(r){const t=[];let e=Object.getPrototypeOf(r);for(null!==e&&(e=Object.getPrototypeOf(e));null!==e;)t.push(e.constructor.name),e=Object.getPrototypeOf(e);return t}},{}],6:[function(r,t,e){"use strict";const n=r("./get-superclasses");t.exports=function(r){if(!(r instanceof Error))return r;const t={};t.name=r.name||"<no name available>",t.className=r.constructor.name||"<no class name available>",t.message=r.message||"<no message available>",t.superclasses=n(r),t.enumerableFields={};for(const e in r)"function"!=typeof r[e]&&(t.enumerableFields[e]=r[e]);return"string"==typeof r.stack&&r.stack.length>0?t.stack=r.stack.split("\n").map(r=>r.replace(/^\s+/,"")).filter(r=>r):t.stack=r.stack||"<no stack trace available>",t}},{"./get-superclasses":5}],7:[function(r,t,e){"use strict";const n=r("./map-arg"),o=["log","debug","info","warn","error"];let s=!1;t.exports=function(){if(s)return;s=!0;const r={};for(const t of o)console[t]&&(r[t]=console[t].bind(console),console[t]=function(...e){r[t](...e.map(n))})}},{"./map-arg":4}],8:[function(r,t,e){"use strict";const n=r("./jsonify-error"),o=r("./to-string");t.exports=function(){Error.prototype.toJSON=function(){return n(this)},Error.prototype.toString=function(r=4){return o(this,r)}}},{"./jsonify-error":6,"./to-string":9}],9:[function(r,t,e){"use strict";const n=r("json-stringify-safe"),o=r("./jsonify-error");t.exports=function(r,t=4){if(!(r instanceof Error))throw new TypeError("jsonifyError.toString() error: First argument must be instance of Error.");const e=o(r);return`${e.className}: ${e.message} ${n(e,null,t)}`}},{"./jsonify-error":6,"json-stringify-safe":10}],10:[function(r,t,e){function n(r,t){var e=[],n=[];return null==t&&(t=function(r,t){return e[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,e.indexOf(t)).join(".")+"]"}),function(o,s){if(e.length>0){var i=e.indexOf(this);~i?e.splice(i+1):e.push(this),~i?n.splice(i,1/0,o):n.push(o),~e.indexOf(s)&&(s=t.call(this,o,s))}else e.push(s);return null==r?s:r.call(this,o,s)}}(t.exports=function(r,t,e,o){return JSON.stringify(r,n(t,o),e)}).getSerialize=n},{}]},{},[1]); | ||
!function(){return function r(t,e,n){function o(i,c){if(!e[i]){if(!t[i]){var u="function"==typeof require&&require;if(!c&&u)return u(i,!0);if(s)return s(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var a=e[i]={exports:{}};t[i][0].call(a.exports,function(r){return o(t[i][1][r]||r)},a,a.exports,r,t,e,n)}return e[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}}()({1:[function(r,t,e){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,t,e){"use strict";const n=r("./lib/jsonify-error"),o=r("./lib/override-console"),s=r("./lib/override-error-methods"),i=r("./lib/log"),c=r("./lib/to-string");t.exports=n,t.exports.overrideConsole=o,t.exports.overrideErrorMethods=s,t.exports.log=i,t.exports.asString=c},{"./lib/jsonify-error":6,"./lib/log":3,"./lib/override-console":7,"./lib/override-error-methods":8,"./lib/to-string":10}],3:[function(r,t,e){"use strict";const n=r("./../map-arg");t.exports=function(r){console.error(n(r))}},{"./../map-arg":4}],4:[function(r,t,e){"use strict";const n=r("./../jsonify-error");t.exports=function(r){return r instanceof Error?n(r):r}},{"./../jsonify-error":6}],5:[function(r,t,e){"use strict";t.exports=function(r){const t=[];let e=Object.getPrototypeOf(r);for(null!==e&&(e=Object.getPrototypeOf(e));null!==e;)t.push(e.constructor.name),e=Object.getPrototypeOf(e);return t}},{}],6:[function(r,t,e){"use strict";const n=r("./get-superclasses"),o=r("./strip-colors-if-string");t.exports=function(r){if(!(r instanceof Error))return r;const t={};t.name=r.name||"<no name available>",t.className=r.constructor.name||"<no class name available>",t.message=o(r.message)||"<no message available>",t.superclasses=n(r),t.enumerableFields={};for(const e in r)"function"!=typeof r[e]&&(t.enumerableFields[e]=o(r[e]));return"string"==typeof r.stack&&r.stack.length>0?t.stack=r.stack.split("\n").map(r=>r.replace(/^\s+/,"")).filter(r=>r).map(o):t.stack=o(r.stack)||"<no stack trace available>",t}},{"./get-superclasses":5,"./strip-colors-if-string":9}],7:[function(r,t,e){"use strict";const n=r("./map-arg"),o=["log","debug","info","warn","error"];let s=!1;t.exports=function(){if(s)return;s=!0;const r={};for(const t of o)console[t]&&(r[t]=console[t].bind(console),console[t]=function(...e){r[t](...e.map(n))})}},{"./map-arg":4}],8:[function(r,t,e){"use strict";const n=r("./jsonify-error"),o=r("./to-string");t.exports=function(){Error.prototype.toJSON=function(){return n(this)},Error.prototype.toString=function(r=4){return o(this,r)}}},{"./jsonify-error":6,"./to-string":10}],9:[function(r,t,e){"use strict";t.exports=function(r){return"string"!=typeof r?r:r.replace(/\u001b\[\d{1,2}m/g,"").replace(/\\u001b\[\d{1,2}m/g,"")}},{}],10:[function(r,t,e){"use strict";const n=r("json-stringify-safe"),o=r("./jsonify-error");t.exports=function(r,t=4){if(!(r instanceof Error))throw new TypeError("jsonifyError.toString() error: First argument must be instance of Error.");const e=o(r);return`${e.className}: ${e.message} ${n(e,null,t)}`}},{"./jsonify-error":6,"json-stringify-safe":11}],11:[function(r,t,e){function n(r,t){var e=[],n=[];return null==t&&(t=function(r,t){return e[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,e.indexOf(t)).join(".")+"]"}),function(o,s){if(e.length>0){var i=e.indexOf(this);~i?e.splice(i+1):e.push(this),~i?n.splice(i,1/0,o):n.push(o),~e.indexOf(s)&&(s=t.call(this,o,s))}else e.push(s);return null==r?s:r.call(this,o,s)}}(t.exports=function(r,t,e,o){return JSON.stringify(r,n(t,o),e)}).getSerialize=n},{}]},{},[1]); |
@@ -5,2 +5,4 @@ "use strict"; | ||
const stripColorsIfString = require("./strip-colors-if-string"); | ||
module.exports = function jsonifyError(error) { | ||
@@ -11,3 +13,3 @@ if (!(error instanceof Error)) return error; | ||
wrappedError.className = error.constructor.name || "<no class name available>"; | ||
wrappedError.message = error.message || "<no message available>"; | ||
wrappedError.message = stripColorsIfString(error.message) || "<no message available>"; | ||
wrappedError.superclasses = getSuperclasses(error); | ||
@@ -17,10 +19,10 @@ wrappedError.enumerableFields = {}; | ||
if (typeof error[x] === "function") continue; | ||
wrappedError.enumerableFields[x] = error[x]; | ||
wrappedError.enumerableFields[x] = stripColorsIfString(error[x]); | ||
} | ||
if (typeof error.stack === "string" && error.stack.length > 0) { | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")).filter(x => x); | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")).filter(x => x).map(stripColorsIfString); | ||
} else { | ||
wrappedError.stack = error.stack || "<no stack trace available>"; | ||
wrappedError.stack = stripColorsIfString(error.stack) || "<no stack trace available>"; | ||
} | ||
return wrappedError; | ||
}; |
{ | ||
"name": "jsonify-error", | ||
"version": "1.4.5", | ||
"version": "2.0.0", | ||
"description": "Convert errors to JSON or to a good string. Develop faster with better error messages.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,3 +49,3 @@ jsonify-error | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/jsonify-error@1.4.5/dist/jsonify-error.min.js" integrity="sha384-A2afflOLQT8nKkxHmgVLTXSDlUB8vEueEDlBCCSFOI+tF9LB1lVI+Y8Ur3R5ZR0o" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/jsonify-error@2.0.0/dist/jsonify-error.min.js" integrity="sha384-k3Is8aV5PW6XO2NtZyFbjgZLKNWv4kFrtuN0cnOhaw+qKurzZIlOZZNmih+HGKpN" crossorigin="anonymous"></script> | ||
``` | ||
@@ -52,0 +52,0 @@ |
Sorry, the diff of this file is not supported yet
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
79610
22
583