catch.js
Version:
Catch and handle errors after deployment
15 lines (14 loc) • 571 B
JavaScript
// Browserify / Node.js
if (typeof define === "function" && define.amd) {
define(() => new Catch);
// CommonJS and Node.js module support.
} else if (typeof exports !== "undefined") {
// Support Node.js specific `module.exports` (which can be a function)
if (typeof module !== "undefined" && module.exports) {
exports = module.exports = new Catch;
}
// But always support CommonJS module 1.1.1 spec (`exports` cannot be a function)
exports.Catch = new Catch;
} else if (typeof global !== "undefined") {
global.Catch = new Catch;
}