jsonify-error
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -9,2 +9,8 @@ # Changelog | ||
## [1.4.2] - 2018-11-12 | ||
### Fixed | ||
- No longer stringify on browsers, letting the object be logged directly instead. | ||
- Remove empty stack entries | ||
- Fixed typo in changelog | ||
## [1.4.1] - 2018-10-27 | ||
@@ -73,4 +79,5 @@ ### Added | ||
[Unreleased]: https://github.com/papb/jsonify-error/compare/v1.4.1...HEAD | ||
[1.4.0]: https://github.com/papb/jsonify-error/compare/v1.4.0...v1.4.1 | ||
[Unreleased]: https://github.com/papb/jsonify-error/compare/v1.4.2...HEAD | ||
[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 | ||
@@ -77,0 +84,0 @@ [1.3.1]: https://github.com/papb/jsonify-error/compare/v1.3.0...v1.3.1 |
@@ -21,14 +21,24 @@ (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":5,"./lib/log":3,"./lib/override-console":6,"./lib/override-error-methods":7,"./lib/to-string":8}],3:[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){ | ||
"use strict"; | ||
var toString = require("./../to-string"); | ||
var mapArg = require("./../map-arg"); | ||
module.exports = function log(error) { | ||
var amountOfSpaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4; | ||
// In browsers, we do not colorize the error with chalk. | ||
console.error(mapArg(error)); | ||
}; | ||
console.error(toString(error, amountOfSpaces)); | ||
},{"./../map-arg":4}],4:[function(require,module,exports){ | ||
"use strict"; | ||
var jsonifyError = require("./../jsonify-error"); | ||
module.exports = function mapArg(arg) { | ||
// In browsers, we convert the error to JSON but not to string, since the browser's | ||
// console is interactive and allows inspecting the plain object easily. | ||
return arg instanceof Error ? jsonifyError(arg) : arg; | ||
}; | ||
},{"./../to-string":8}],4:[function(require,module,exports){ | ||
},{"./../jsonify-error":6}],5:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -47,3 +57,3 @@ | ||
},{}],5:[function(require,module,exports){ | ||
},{}],6:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -68,2 +78,4 @@ | ||
return x.replace(/^\s+/, ""); | ||
}).filter(function (x) { | ||
return x; | ||
}); | ||
@@ -76,3 +88,3 @@ } else { | ||
},{"./get-superclasses":4}],6:[function(require,module,exports){ | ||
},{"./get-superclasses":5}],7:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -82,10 +94,4 @@ | ||
var toString = require("./to-string"); | ||
var mapArg = require("./map-arg"); | ||
function mapArgs(args) { | ||
return args.map(function (arg) { | ||
return arg instanceof Error ? toString(arg) : arg; | ||
}); | ||
} | ||
var methodNames = ["log", "debug", "info", "warn", "error"]; | ||
@@ -95,3 +101,3 @@ | ||
module.exports = function () { | ||
module.exports = function overrideConsole() { | ||
if (alreadyOverridden) return; | ||
@@ -110,3 +116,3 @@ alreadyOverridden = true; | ||
originalMethods[methodName].apply(originalMethods, _toConsumableArray(mapArgs(args))); | ||
originalMethods[methodName].apply(originalMethods, _toConsumableArray(args.map(mapArg))); | ||
}; | ||
@@ -143,3 +149,3 @@ }; | ||
},{"./to-string":8}],7:[function(require,module,exports){ | ||
},{"./map-arg":4}],8:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -177,3 +183,3 @@ | ||
},{"./jsonify-error":5,"./to-string":8}],8:[function(require,module,exports){ | ||
},{"./jsonify-error":6,"./to-string":9}],9:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -202,3 +208,3 @@ | ||
},{"./jsonify-error":5}]},{},[1]) | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJicm93c2VyLWVudHJ5cG9pbnQuanMiLCJpbmRleC5qcyIsImxpYi9icm93c2VyLXNwZWNpZmljL2xvZy5qcyIsImxpYi9nZXQtc3VwZXJjbGFzc2VzLmpzIiwibGliL2pzb25pZnktZXJyb3IuanMiLCJsaWIvb3ZlcnJpZGUtY29uc29sZS5qcyIsImxpYi9vdmVycmlkZS1lcnJvci1tZXRob2RzLmpzIiwibGliL3RvLXN0cmluZy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBOztBQUNBLE9BQU8sWUFBUCxHQUFzQixRQUFRLFlBQVIsQ0FBdEI7OztBQ0RBOztBQUVBLElBQU0sZUFBZSxRQUFRLHFCQUFSLENBQXJCO0FBQ0EsSUFBTSxrQkFBa0IsUUFBUSx3QkFBUixDQUF4QjtBQUNBLElBQU0sdUJBQXVCLFFBQVEsOEJBQVIsQ0FBN0I7QUFDQSxJQUFNLE1BQU0sUUFBUSxXQUFSLENBQVo7QUFDQSxJQUFNLFdBQVcsUUFBUSxpQkFBUixDQUFqQjs7QUFFQSxPQUFPLE9BQVAsR0FBaUIsWUFBakI7QUFDQSxPQUFPLE9BQVAsQ0FBZSxlQUFmLEdBQWlDLGVBQWpDO0FBQ0EsT0FBTyxPQUFQLENBQWUsb0JBQWYsR0FBc0Msb0JBQXRDO0FBQ0EsT0FBTyxPQUFQLENBQWUsR0FBZixHQUFxQixHQUFyQjtBQUNBLE9BQU8sT0FBUCxDQUFlLFFBQWYsR0FBMEIsUUFBMUI7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pdHMgSlNPTiByZXByZXNlbnRhdGlvbi5cclxuICogXHJcbiAqIEBwYXJhbSB7ZXJyb3J9IGVycm9yIFRoZSBlcnJvciB0byBiZSBjb252ZXJ0ZWQuXHJcbiAqIEBwYXJhbSB7bnVtYmVyfSBbYW1vdW50T2ZTcGFjZXM9NF0gVGhlIGFtb3VudCBvZiBzcGFjZXMgdG8gdXNlXHJcbiAqIGZvciBpbmRlbnRhdGlvbiBpbiB0aGUgb3V0cHV0IHN0cmluZy5cclxuICogXHJcbiAqIEByZXR1cm4ge3N0cmluZ31cclxuICogQHRocm93cyB7VHlwZUVycm9yfSBJZiB0aGUgZ2l2ZW4gZXJyb3IgaXMgbm90IGFuIGluc3RhbmNlIG9mIEVycm9yXHJcbiAqL1xyXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHRvU3RyaW5nKGVycm9yLCBhbW91bnRPZlNwYWNlcyA9IDQpIHtcclxuICAgIGlmICghKGVycm9yIGluc3RhbmNlb2YgRXJyb3IpKSB0aHJvdyBuZXcgVHlwZUVycm9yKFwianNvbmlmeUVycm9yLnRvU3RyaW5nKCkgZXJyb3I6IEZpcnN0IGFyZ3VtZW50IG11c3QgYmUgaW5zdGFuY2Ugb2YgRXJyb3IuXCIpO1xyXG4gICAgY29uc3QgYXNKU09OID0ganNvbmlmeUVycm9yKGVycm9yKTtcclxuICAgIHJldHVybiBgJHthc0pTT04uY2xhc3NOYW1lfTogJHthc0pTT04ubWVzc2FnZX0gJHtKU09OLnN0cmluZ2lmeShhc0pTT04sIG51bGwsIGFtb3VudE9mU3BhY2VzKX1gO1xyXG59OyJdfQ== | ||
},{"./jsonify-error":6}]},{},[1]) | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJicm93c2VyLWVudHJ5cG9pbnQuanMiLCJpbmRleC5qcyIsImx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0pTT04sIG51bGwsIGFtb3VudE9mU3BhY2VzKX1gO1xyXG59OyJdfQ== |
@@ -1,1 +0,1 @@ | ||
!function(){return function r(t,e,o){function n(s,a){if(!e[s]){if(!t[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=e[s]={exports:{}};t[s][0].call(f.exports,function(r){return n(t[s][1][r]||r)},f,f.exports,r,t,e,o)}return e[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}}()({1:[function(r,t,e){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,t,e){"use strict";var o=r("./lib/jsonify-error"),n=r("./lib/override-console"),i=r("./lib/override-error-methods"),s=r("./lib/log"),a=r("./lib/to-string");t.exports=o,t.exports.overrideConsole=n,t.exports.overrideErrorMethods=i,t.exports.log=s,t.exports.asString=a},{"./lib/jsonify-error":5,"./lib/log":3,"./lib/override-console":6,"./lib/override-error-methods":7,"./lib/to-string":8}],3:[function(r,t,e){"use strict";var o=r("./../to-string");t.exports=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;console.error(o(r,t))}},{"./../to-string":8}],4:[function(r,t,e){"use strict";t.exports=function(r){var t=[],e=Object.getPrototypeOf(r);for(null!==e&&(e=Object.getPrototypeOf(e));null!==e;)t.push(e.constructor.name),e=Object.getPrototypeOf(e);return t}},{}],5:[function(r,t,e){"use strict";var o=r("./get-superclasses");t.exports=function(r){if(!(r instanceof Error))return r;var t={};for(var e in 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=o(r),t.enumerableFields={},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(function(r){return r.replace(/^\s+/,"")}):t.stack=r.stack||"<no stack trace available>",t}},{"./get-superclasses":4}],6:[function(r,t,e){"use strict";var o=r("./to-string");var n=["log","debug","info","warn","error"],i=!1;t.exports=function(){if(!i){i=!0;var r={},t=function(t){if(!console[t])return"continue";r[t]=console[t].bind(console),console[t]=function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];r[t].apply(r,function(r){if(Array.isArray(r)){for(var t=0,e=Array(r.length);t<r.length;t++)e[t]=r[t];return e}return Array.from(r)}(function(r){return r.map(function(r){return r instanceof Error?o(r):r})}(n)))}},e=!0,s=!1,a=void 0;try{for(var u,c=n[Symbol.iterator]();!(e=(u=c.next()).done);e=!0)t(u.value)}catch(r){s=!0,a=r}finally{try{!e&&c.return&&c.return()}finally{if(s)throw a}}}}},{"./to-string":8}],7:[function(r,t,e){"use strict";var o=r("./jsonify-error"),n=r("./to-string");t.exports=function(){Error.prototype.toJSON=function(){return o(this)},Error.prototype.toString=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return n(this,r)}}},{"./jsonify-error":5,"./to-string":8}],8:[function(r,t,e){"use strict";var o=r("./jsonify-error");t.exports=function(r){var t=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 e=o(r);return e.className+": "+e.message+" "+JSON.stringify(e,null,t)}},{"./jsonify-error":5}]},{},[1]); | ||
!function(){return function r(e,t,o){function n(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 n(e[s][1][r]||r)},f,f.exports,r,e,t,o)}return t[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}}()({1:[function(r,e,t){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,e,t){"use strict";var o=r("./lib/jsonify-error"),n=r("./lib/override-console"),i=r("./lib/override-error-methods"),s=r("./lib/log"),a=r("./lib/to-string");e.exports=o,e.exports.overrideConsole=n,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,t){"use strict";var o=r("./../map-arg");e.exports=function(r){console.error(o(r))}},{"./../map-arg":4}],4:[function(r,e,t){"use strict";var o=r("./../jsonify-error");e.exports=function(r){return r instanceof Error?o(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 o=r("./get-superclasses");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=r.message||"<no message available>",e.superclasses=o(r),e.enumerableFields={},r)"function"!=typeof r[t]&&(e.enumerableFields[t]=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}):e.stack=r.stack||"<no stack trace available>",e}},{"./get-superclasses":5}],7:[function(r,e,t){"use strict";var o=r("./map-arg"),n=["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,n=Array(t),i=0;i<t;i++)n[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)}(n.map(o)))}},t=!0,s=!1,a=void 0;try{for(var u,c=n[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 o=r("./jsonify-error"),n=r("./to-string");e.exports=function(){Error.prototype.toJSON=function(){return o(this)},Error.prototype.toString=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return n(this,r)}}},{"./jsonify-error":6,"./to-string":9}],9:[function(r,e,t){"use strict";var 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+" "+JSON.stringify(t,null,e)}},{"./jsonify-error":6}]},{},[1]); |
@@ -18,13 +18,24 @@ (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":5,"./lib/log":3,"./lib/override-console":6,"./lib/override-error-methods":7,"./lib/to-string":8}],3:[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){ | ||
"use strict"; | ||
const toString = require("./../to-string"); | ||
const mapArg = require("./../map-arg"); | ||
module.exports = function log(error, amountOfSpaces = 4) { | ||
console.error(toString(error, amountOfSpaces)); | ||
module.exports = function log(error) { | ||
// In browsers, we do not colorize the error with chalk. | ||
console.error(mapArg(error)); | ||
}; | ||
},{"./../to-string":8}],4:[function(require,module,exports){ | ||
},{"./../map-arg":4}],4:[function(require,module,exports){ | ||
"use strict"; | ||
const jsonifyError = require("./../jsonify-error"); | ||
module.exports = function mapArg(arg) { | ||
// In browsers, we convert the error to JSON but not to string, since the browser's | ||
// console is interactive and allows inspecting the plain object easily. | ||
return arg instanceof Error ? jsonifyError(arg) : arg; | ||
}; | ||
},{"./../jsonify-error":6}],5:[function(require,module,exports){ | ||
"use strict"; | ||
module.exports = function getSuperclasses(obj) { | ||
@@ -40,3 +51,3 @@ const superclasses = []; | ||
}; | ||
},{}],5:[function(require,module,exports){ | ||
},{}],6:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -59,3 +70,3 @@ | ||
if (typeof error.stack === "string" && error.stack.length > 0) { | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")); | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")).filter(x => x); | ||
} else { | ||
@@ -66,11 +77,7 @@ wrappedError.stack = error.stack || "<no stack trace available>"; | ||
}; | ||
},{"./get-superclasses":4}],6:[function(require,module,exports){ | ||
},{"./get-superclasses":5}],7:[function(require,module,exports){ | ||
"use strict"; | ||
const toString = require("./to-string"); | ||
const mapArg = require("./map-arg"); | ||
function mapArgs(args) { | ||
return args.map(arg => arg instanceof Error ? toString(arg) : arg); | ||
} | ||
const methodNames = ["log", "debug", "info", "warn", "error"]; | ||
@@ -80,3 +87,3 @@ | ||
module.exports = function() { | ||
module.exports = function overrideConsole() { | ||
if (alreadyOverridden) return; | ||
@@ -91,7 +98,7 @@ alreadyOverridden = true; | ||
console[methodName] = function(...args) { | ||
originalMethods[methodName](...mapArgs(args)); | ||
originalMethods[methodName](...args.map(mapArg)); | ||
}; | ||
} | ||
}; | ||
},{"./to-string":8}],7:[function(require,module,exports){ | ||
},{"./map-arg":4}],8:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -127,3 +134,3 @@ | ||
}; | ||
},{"./jsonify-error":5,"./to-string":8}],8:[function(require,module,exports){ | ||
},{"./jsonify-error":6,"./to-string":9}],9:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -149,3 +156,3 @@ | ||
}; | ||
},{"./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iB0aGUgb3V0cHV0IHN0cmluZy5cclxuICogXHJcbiAqIEByZXR1cm4ge3N0cmluZ31cclxuICogQHRocm93cyB7VHlwZUVycm9yfSBJZiB0aGUgZ2l2ZW4gZXJyb3IgaXMgbm90IGFuIGluc3RhbmNlIG9mIEVycm9yXHJcbiAqL1xyXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHRvU3RyaW5nKGVycm9yLCBhbW91bnRPZlNwYWNlcyA9IDQpIHtcclxuICAgIGlmICghKGVycm9yIGluc3RhbmNlb2YgRXJyb3IpKSB0aHJvdyBuZXcgVHlwZUVycm9yKFwianNvbmlmeUVycm9yLnRvU3RyaW5nKCkgZXJyb3I6IEZpcnN0IGFyZ3VtZW50IG11c3QgYmUgaW5zdGFuY2Ugb2YgRXJyb3IuXCIpO1xyXG4gICAgY29uc3QgYXNKU09OID0ganNvbmlmeUVycm9yKGVycm9yKTtcclxuICAgIHJldHVybiBgJHthc0pTT04uY2xhc3NOYW1lfTogJHthc0pTT04ubWVzc2FnZX0gJHtKU09OLnN0cmluZ2lmeShhc0pTT04sIG51bGwsIGFtb3VudE9mU3BhY2VzKX1gO1xyXG59OyJdfQ== | ||
},{"./jsonify-error":6}]},{},[1]) | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJicm93c2VyLWVudHJ5cG9pbnQuanMiLCJpbmRleC5qcyIsImxpYi9icm93c2VyLXNwZWNpZmljL2xvZy5qcyIsImxpYi9icm93c2VyLXNwZWNpZmljL21hcC1hcmcuanMiLCJsaWIvZ2V0LXN1cGVyY2xhc3Nlcy5qcyIsImxpYi9qc29uaWZ5LWVycm9yLmpzIiwibGliL292ZXJyaWRlLWNvbnNvbGUuanMiLCJsaWIvb3ZlcnJpZGUtZXJyb3ItbWV0aG9kcy5qcyIsImxpYi90by1zdHJpbmcu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GFyYW0ge251bWJlcn0gW2Ftb3VudE9mU3BhY2VzPTRdIFRoZSBhbW91bnQgb2Ygc3BhY2VzIHRvIHVzZVxyXG4gKiBmb3IgaW5kZW50YXRpb24gaW4gdGhlIG91dHB1dCBzdHJpbmcuXHJcbiAqIFxyXG4gKiBAcmV0dXJuIHtzdHJpbmd9XHJcbiAqIEB0aHJvd3Mge1R5cGVFcnJvcn0gSWYgdGhlIGdpdmVuIGVycm9yIGlzIG5vdCBhbiBpbnN0YW5jZSBvZiBFcnJvclxyXG4gKi9cclxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiB0b1N0cmluZyhlcnJvciwgYW1vdW50T2ZTcGFjZXMgPSA0KSB7XHJcbiAgICBpZiAoIShlcnJvciBpbnN0YW5jZW9mIEVycm9yKSkgdGhyb3cgbmV3IFR5cGVFcnJvcihcImpzb25pZnlFcnJvci50b1N0cmluZygpIGVycm9yOiBGaXJzdCBhcmd1bWVudCBtdXN0IGJlIGluc3RhbmNlIG9mIEVycm9yLlwiKTtcclxuICAgIGNvbnN0IGFzSlNPTiA9IGpzb25pZnlFcnJvcihlcnJvcik7XHJcbiAgICByZXR1cm4gYCR7YXNKU09OLmNsYXNzTmFtZX06ICR7YXNKU09OLm1lc3NhZ2V9ICR7SlNPTi5zdHJpbmdpZnkoYXNKU09OLCBudWxsLCBhbW91bnRPZlNwYWNlcyl9YDtcclxufTsiXX0= |
@@ -1,1 +0,1 @@ | ||
!function(){return function r(o,t,e){function n(i,c){if(!t[i]){if(!o[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=t[i]={exports:{}};o[i][0].call(a.exports,function(r){return n(o[i][1][r]||r)},a,a.exports,r,o,t,e)}return t[i].exports}for(var s="function"==typeof require&&require,i=0;i<e.length;i++)n(e[i]);return n}}()({1:[function(r,o,t){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,o,t){"use strict";const e=r("./lib/jsonify-error"),n=r("./lib/override-console"),s=r("./lib/override-error-methods"),i=r("./lib/log"),c=r("./lib/to-string");o.exports=e,o.exports.overrideConsole=n,o.exports.overrideErrorMethods=s,o.exports.log=i,o.exports.asString=c},{"./lib/jsonify-error":5,"./lib/log":3,"./lib/override-console":6,"./lib/override-error-methods":7,"./lib/to-string":8}],3:[function(r,o,t){"use strict";const e=r("./../to-string");o.exports=function(r,o=4){console.error(e(r,o))}},{"./../to-string":8}],4:[function(r,o,t){"use strict";o.exports=function(r){const o=[];let t=Object.getPrototypeOf(r);for(null!==t&&(t=Object.getPrototypeOf(t));null!==t;)o.push(t.constructor.name),t=Object.getPrototypeOf(t);return o}},{}],5:[function(r,o,t){"use strict";const e=r("./get-superclasses");o.exports=function(r){if(!(r instanceof Error))return r;const o={};o.name=r.name||"<no name available>",o.className=r.constructor.name||"<no class name available>",o.message=r.message||"<no message available>",o.superclasses=e(r),o.enumerableFields={};for(const t in r)"function"!=typeof r[t]&&(o.enumerableFields[t]=r[t]);return"string"==typeof r.stack&&r.stack.length>0?o.stack=r.stack.split("\n").map(r=>r.replace(/^\s+/,"")):o.stack=r.stack||"<no stack trace available>",o}},{"./get-superclasses":4}],6:[function(r,o,t){"use strict";const e=r("./to-string");function n(r){return r.map(r=>r instanceof Error?e(r):r)}const s=["log","debug","info","warn","error"];let i=!1;o.exports=function(){if(i)return;i=!0;const r={};for(const o of s)console[o]&&(r[o]=console[o].bind(console),console[o]=function(...t){r[o](...n(t))})}},{"./to-string":8}],7:[function(r,o,t){"use strict";const e=r("./jsonify-error"),n=r("./to-string");o.exports=function(){Error.prototype.toJSON=function(){return e(this)},Error.prototype.toString=function(r=4){return n(this,r)}}},{"./jsonify-error":5,"./to-string":8}],8:[function(r,o,t){"use strict";const e=r("./jsonify-error");o.exports=function(r,o=4){if(!(r instanceof Error))throw new TypeError("jsonifyError.toString() error: First argument must be instance of Error.");const t=e(r);return`${t.className}: ${t.message} ${JSON.stringify(t,null,o)}`}},{"./jsonify-error":5}]},{},[1]); | ||
!function(){return function r(o,t,e){function n(i,c){if(!t[i]){if(!o[i]){var u="function"==typeof require&&require;if(!c&&u)return u(i,!0);if(s)return s(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var f=t[i]={exports:{}};o[i][0].call(f.exports,function(r){return n(o[i][1][r]||r)},f,f.exports,r,o,t,e)}return t[i].exports}for(var s="function"==typeof require&&require,i=0;i<e.length;i++)n(e[i]);return n}}()({1:[function(r,o,t){"use strict";window.jsonifyError=r("./index.js")},{"./index.js":2}],2:[function(r,o,t){"use strict";const e=r("./lib/jsonify-error"),n=r("./lib/override-console"),s=r("./lib/override-error-methods"),i=r("./lib/log"),c=r("./lib/to-string");o.exports=e,o.exports.overrideConsole=n,o.exports.overrideErrorMethods=s,o.exports.log=i,o.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,o,t){"use strict";const e=r("./../map-arg");o.exports=function(r){console.error(e(r))}},{"./../map-arg":4}],4:[function(r,o,t){"use strict";const e=r("./../jsonify-error");o.exports=function(r){return r instanceof Error?e(r):r}},{"./../jsonify-error":6}],5:[function(r,o,t){"use strict";o.exports=function(r){const o=[];let t=Object.getPrototypeOf(r);for(null!==t&&(t=Object.getPrototypeOf(t));null!==t;)o.push(t.constructor.name),t=Object.getPrototypeOf(t);return o}},{}],6:[function(r,o,t){"use strict";const e=r("./get-superclasses");o.exports=function(r){if(!(r instanceof Error))return r;const o={};o.name=r.name||"<no name available>",o.className=r.constructor.name||"<no class name available>",o.message=r.message||"<no message available>",o.superclasses=e(r),o.enumerableFields={};for(const t in r)"function"!=typeof r[t]&&(o.enumerableFields[t]=r[t]);return"string"==typeof r.stack&&r.stack.length>0?o.stack=r.stack.split("\n").map(r=>r.replace(/^\s+/,"")).filter(r=>r):o.stack=r.stack||"<no stack trace available>",o}},{"./get-superclasses":5}],7:[function(r,o,t){"use strict";const e=r("./map-arg"),n=["log","debug","info","warn","error"];let s=!1;o.exports=function(){if(s)return;s=!0;const r={};for(const o of n)console[o]&&(r[o]=console[o].bind(console),console[o]=function(...t){r[o](...t.map(e))})}},{"./map-arg":4}],8:[function(r,o,t){"use strict";const e=r("./jsonify-error"),n=r("./to-string");o.exports=function(){Error.prototype.toJSON=function(){return e(this)},Error.prototype.toString=function(r=4){return n(this,r)}}},{"./jsonify-error":6,"./to-string":9}],9:[function(r,o,t){"use strict";const e=r("./jsonify-error");o.exports=function(r,o=4){if(!(r instanceof Error))throw new TypeError("jsonifyError.toString() error: First argument must be instance of Error.");const t=e(r);return`${t.className}: ${t.message} ${JSON.stringify(t,null,o)}`}},{"./jsonify-error":6}]},{},[1]); |
"use strict"; | ||
const toString = require("./../to-string"); | ||
const mapArg = require("./../map-arg"); | ||
module.exports = function log(error, amountOfSpaces = 4) { | ||
console.error(toString(error, amountOfSpaces)); | ||
module.exports = function log(error) { | ||
// In browsers, we do not colorize the error with chalk. | ||
console.error(mapArg(error)); | ||
}; |
@@ -18,3 +18,3 @@ "use strict"; | ||
if (typeof error.stack === "string" && error.stack.length > 0) { | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")); | ||
wrappedError.stack = error.stack.split('\n').map(x => x.replace(/^\s+/, "")).filter(x => x); | ||
} else { | ||
@@ -21,0 +21,0 @@ wrappedError.stack = error.stack || "<no stack trace available>"; |
"use strict"; | ||
const toString = require("./to-string"); | ||
const mapArg = require("./map-arg"); | ||
const chalk = require("chalk"); | ||
module.exports = function log(error, amountOfSpaces = 4) { | ||
console.error(chalk.red(toString(error, amountOfSpaces))); | ||
module.exports = function log(error) { | ||
// In node, we colorize the error with chalk. | ||
console.error(chalk.red(mapArg(error))); | ||
}; |
"use strict"; | ||
const toString = require("./to-string"); | ||
const mapArg = require("./map-arg"); | ||
function mapArgs(args) { | ||
return args.map(arg => arg instanceof Error ? toString(arg) : arg); | ||
} | ||
const methodNames = ["log", "debug", "info", "warn", "error"]; | ||
@@ -13,3 +9,3 @@ | ||
module.exports = function() { | ||
module.exports = function overrideConsole() { | ||
if (alreadyOverridden) return; | ||
@@ -24,5 +20,5 @@ alreadyOverridden = true; | ||
console[methodName] = function(...args) { | ||
originalMethods[methodName](...mapArgs(args)); | ||
originalMethods[methodName](...args.map(mapArg)); | ||
}; | ||
} | ||
}; |
{ | ||
"name": "jsonify-error", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Convert errors to JSON or to a good string. Develop faster with better error messages.", | ||
"main": "index.js", | ||
"browser": { | ||
"./lib/log.js": "./lib/browser-specific/log.js" | ||
"./lib/log.js": "./lib/browser-specific/log.js", | ||
"./lib/map-arg.js": "./lib/browser-specific/map-arg.js" | ||
}, | ||
@@ -9,0 +10,0 @@ "jsdelivr": "dist/jsonify-error.js", |
@@ -8,2 +8,3 @@ jsonify-error | ||
[![Build status][build-status-badge]][travis-url] | ||
[![Minzipped size][minzipped-size-badge]][bundlephobia-url] | ||
[![License][license-badge]][license-url] | ||
@@ -49,3 +50,3 @@ [![NPM downloads][npm-downloads-badge]][npm-url] | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/jsonify-error@1.4.1/dist/jsonify-error.js" integrity="sha384-9Ni+25jkkXj+pXOvuHydIUaYOKpW7XBquZJ0/JV+u0Nf9fJ1oqSjku2/m4aFBw53" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/jsonify-error@1.4.2/dist/jsonify-error.js" integrity="sha384-B9AkyzYw+s6w99UNNaQ7diizuHePzKhOg7qUG1Eb/MQ7mPQqLdCdoH6NFe4DtNAZ" crossorigin="anonymous"></script> | ||
``` | ||
@@ -116,3 +117,3 @@ | ||
jsonifyError.log(e); | ||
process.exit(1); | ||
// ... | ||
} | ||
@@ -124,3 +125,3 @@ ``` | ||
```javascript | ||
var jsonifyError = require("jsonify-error"); | ||
const jsonifyError = require("jsonify-error"); | ||
@@ -131,3 +132,3 @@ somethingAsync().then(() => { | ||
jsonifyError.log(e); | ||
// process.exit(1); // Exiting or not depends on your situation | ||
// ... | ||
}); | ||
@@ -150,2 +151,4 @@ ``` | ||
Note: if you've overriden error methods (by calling `jsonifyError.overrideErrorMethods()`), the above can be simplified to `res.status(500).json(error)` (see the *overriding methods* section). | ||
## Example usage: overriding methods | ||
@@ -176,2 +179,3 @@ | ||
[build-status-badge]: https://badgen.net/travis/papb/papb-js-snippets | ||
[minzipped-size-badge]: https://badgen.net/bundlephobia/minzip/jsonify-error | ||
[dependency-status-badge]: https://badgen.net/david/dep/papb/jsonify-error | ||
@@ -188,2 +192,3 @@ [dev-dependency-status-badge]: https://badgen.net/david/dev/papb/jsonify-error | ||
[travis-url]: https://travis-ci.com/papb/jsonify-error | ||
[bundlephobia-url]: https://bundlephobia.com/result?p=jsonify-error | ||
[better-promise-error-log]: https://npmjs.org/package/better-promise-error-log |
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
67784
21
492
186