Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

honeybadger-js

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

honeybadger-js - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

CHANGELOG.md

@@ -8,2 +8,6 @@ # Change Log

## [2.0.1] - 2020-01-07
### Fixed
- Fix an error that occurs when a null error is passed with arguments and ignore patterns. -@littleredninja (#266, #270)
## [2.0.0] - 2019-07-24

@@ -10,0 +14,0 @@ ### Added

4

dist/honeybadger.cjs.js
'use strict';
function builder() {
var VERSION = '2.0.0',
var VERSION = '2.0.1',
NOTIFIER = {

@@ -49,2 +49,4 @@ name: 'honeybadger.js',

if (!msg) { return false; }
for (var p in patterns) {

@@ -51,0 +53,0 @@ if (msg.match(patterns[p])) { return true; }

function builder() {
var VERSION = '2.0.0',
var VERSION = '2.0.1',
NOTIFIER = {

@@ -47,2 +47,4 @@ name: 'honeybadger.js',

if (!msg) { return false; }
for (var p in patterns) {

@@ -49,0 +51,0 @@ if (msg.match(patterns[p])) { return true; }

@@ -22,3 +22,3 @@ (function (global, factory) {

function builder() {
var VERSION = '2.0.0',
var VERSION = '2.0.1',
NOTIFIER = {

@@ -83,2 +83,6 @@ name: 'honeybadger.js',

if (!msg) {
return false;
}
for (var p in patterns) {

@@ -85,0 +89,0 @@ if (msg.match(patterns[p])) {

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).Honeybadger=n()}(this,function(){"use strict";function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var e=function(){var b,w,j="2.0.0",k={name:"honeybadger.js",url:"https://github.com/honeybadger-io/honeybadger-js",version:j,language:"javascript"},E=!1,x=!1;function _(e,n){var t={};for(var r in e)t[r]=e[r];for(var r in n)t[r]=n[r];return t}function S(e,n){var t=_(e,n);return e.context&&n.context&&(t.context=_(e.context,n.context)),t}function T(e){return!!b&&b.name===e.name&&b.message===e.message&&b.stack===e.stack}function O(e){return e.stacktrace||e.stack||void 0}return function(e){var c=x,n=[],u=[],f={context:{},beforeNotifyHandlers:[],errorsSent:0};if("object"===R(e))for(var t in e)f[t]=e[t];function s(){var e=window.console;if(e){var n=Array.prototype.slice.call(arguments);n.unshift("[Honeybadger]"),e.log.apply(e,n)}}function l(){if(p("debug"))return s.apply(this,arguments)}function p(e,n){var t=f[e];return void 0===t&&(t=f[e.toLowerCase()]),"false"===t&&(t=!1),void 0!==t?t:n}function d(){return!c&&p("onerror",!0)}function r(e,n){try{var t=new XMLHttpRequest;t.open("POST","http"+(p("ssl",!0)?"s":"")+"://"+p("host","api.honeybadger.io")+"/v1/notices/js",p("async",!0)),t.setRequestHeader("X-API-Key",e),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Accept","text/json, application/json"),t.send(JSON.stringify(function e(n,t){var r,o,i,a;if(i={},t||(t=0),t>=p("max_depth",8))return"[MAX DEPTH REACHED]";for(r in n)o=n[r],Object.prototype.hasOwnProperty.call(n,r)&&null!=r&&null!=o&&((/function|symbol/.test(R(a=o))||"object"===R(a)&&void 0===a.hasOwnProperty)&&(o=Object.prototype.toString.call(o)),i[r]="object"===R(o)?e(o,t+1):o);return i}(n)))}catch(e){s("Unable to send error report: error while initializing request",e,n)}}function v(e){if(b=w=null,p("disabled",!1))return l("Dropping notice: honeybadger.js is disabled",e),!1;var n,t=p("apiKey",p("api_key"));return t?(n=p("maxErrors"))&&f.errorsSent>=n?(l("Dropping notice: max errors exceeded",e),!1):(f.errorsSent++,r(t,e),!0):(s("Unable to send error report: no API key has been configured"),!1)}function y(e,n){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var t=e;e=_(e,{name:t.name,message:t.message,stack:O(t)})}if("object"!==R(e)){var r=String(e);e={message:r}}if(T(e))return!1;if(w&&E&&v(w),function(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!1;return!0}(e))return!1;var o;n&&(e.stack=n.stack,o=n.generator);var i=(e=_(e,{name:e.name||"Error",context:_(f.context,e.context),url:e.url||document.URL,projectRoot:e.projectRoot||e.project_root||p("projectRoot",p("project_root",window.location.protocol+"//"+window.location.host)),environment:e.environment||p("environment"),component:e.component||p("component"),action:e.action||p("action"),revision:e.revision||p("revision")})).stack;if(function(e,n){var t,r;for(t=0,r=e.length;t<r;t++)if(!1===(0,e[t])(n))return!0;return!1}(f.beforeNotifyHandlers,e))return!1;if(e.stack!=i&&(o=void 0),function(e,n){var t=e.message;for(var r in n)if(t.match(n[r]))return!0;return!1}(e,p("ignorePatterns")))return!1;var a,c=((a={}).HTTP_USER_AGENT=navigator.userAgent,document.referrer.match(/\S/)&&(a.HTTP_REFERER=document.referrer),a);"string"==typeof e.cookies?c.HTTP_COOKIE=e.cookies:"object"===R(e.cookies)&&(c.HTTP_COOKIE=function(e){if("object"===R(e)){var n=[];for(var t in e)n.push(t+"="+e[t]);return n.join(";")}}(e.cookies));var s={notifier:k,error:{class:e.name,message:e.message,backtrace:e.stack,generator:o,fingerprint:e.fingerprint},request:{url:e.url,component:e.component,action:e.action,context:e.context,cgi_data:c,params:e.params},server:{project_root:e.projectRoot,environment_name:e.environment,revision:e.revision}};return w=s,b=e,E?(l("Deferring notice",e,s),window.setTimeout(function(){T(e)&&v(s)})):(l("Queuing notice",e,s),u.push(s)),e}var o=!0;if(window.atob||(o=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(o=!1)}catch(e){}function i(n,t){try{return"function"!=typeof n?n:(e=n,"function"!=typeof Object.isExtensible||Object.isExtensible(e)?(n.___hb||(n.___hb=function(){var e=d();if(!(o&&(e||t)||t&&!e))return n.apply(this,arguments);try{return n.apply(this,arguments)}catch(e){throw y(e),e}}),n.___hb.___hb=n.___hb,n.___hb):n)}catch(e){return n}var e}f.notify=function(e,n,t){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var r=e;e=_(e,{name:r.name,message:r.message,stack:O(r)})}return"object"!==R(e)&&(e={message:String(e)}),n&&"object"!==R(n)&&(n={name:String(n)}),n&&(e=S(e,n)),"object"===R(t)&&(e=S(e,t)),y(e,function(e){var n;if(e&&(n=O(e)))return{stack:n,generator:void 0};try{throw new Error("")}catch(e){if(n=O(e))return{stack:n,generator:"throw"}}n=["<call-stack>"];for(var t=arguments.callee;t&&n.length<10;){/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())?n.push(RegExp.$1||"<anonymous>"):n.push("<anonymous>");try{t=t.caller}catch(e){break}}return{stack:n.join("\n"),generator:"walk"}}(e))},f.wrap=function(e){return i(e,!0)},f.setContext=function(e){return"object"===R(e)&&(f.context=_(f.context,e)),f},f.resetContext=function(e){return"object"===R(e)?f.context=_({},e):f.context={},f},f.configure=function(e){for(var n in e)f[n]=e[n];return f},f.beforeNotify=function(e){return f.beforeNotifyHandlers.push(e),f};var a=[].indexOf||function(e){for(var n=0,t=this.length;n<t;n++)if(n in this&&this[n]===e)return n;return-1};function m(e,n,t){if(!c&&e&&n&&t){var r=e[n];e[n]=t(r)}}f.reset=function(){for(var e in f.context={},f.beforeNotifyHandlers=[],f)-1==a.call(n,e)&&(f[e]=void 0);return f.resetMaxErrors(),f},f.resetMaxErrors=function(){return f.errorsSent=0},f.getVersion=function(){return j};var g=function(r){return function(e,n){if("function"!=typeof e)return r(e,n);var t=Array.prototype.slice.call(arguments,2);return e=i(e),r(function(){e.apply(null,t)},n)}};for(var t in m(window,"setTimeout",g),m(window,"setInterval",g),"EventTarget Window Node ApplicationCache AudioTrackList ChannelMergerNode CryptoOperation EventSource FileReader HTMLUnknownElement IDBDatabase IDBRequest IDBTransaction KeyOperation MediaController MessagePort ModalWindow Notification SVGElementInstance Screen TextTrack TextTrackCue TextTrackList WebSocket WebSocketWorker Worker XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload".replace(/\w+/g,function(e){var n=window[e]&&window[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(m(n,"addEventListener",function(o){return function(e,n,t,r){try{n&&null!=n.handleEvent&&(n.handleEvent=i(n.handleEvent))}catch(e){s(e)}return o.call(this,e,i(n),t,r)}}),m(n,"removeEventListener",function(o){return function(e,n,t,r){return o.call(this,e,n,t,r),o.call(this,e,i(n),t,r)}}))}),m(window,"onerror",function(i){return function(e,n,t,r,o){return function(e,n,t,r,o){if(l("window.onerror callback invoked",arguments),!b&&d())if(0===t&&/Script error\.?/.test(e))s("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments);else{var i=[e,"\n at ? (",n||"unknown",":",t||0,":",r||0,")"].join("");if(o){var a={stack:O(o)};return a.stack||(a={stack:i}),y(o,a)}y({name:"window.onerror",message:e,stack:i})}}(e,n,t,r,o),!("function"!=typeof i||!p("_onerror_call_orig",!0))&&i.apply(this,arguments)}}),m(window,"onunhandledrejection",function(n){function t(e){if(l("window.onunhandledrejection callback invoked",arguments),!b&&!c&&p("onunhandledrejection",!0)){var n=e.reason;if(n instanceof Error){var t=n.fileName||"unknown",r=n.lineNumber||0,o="".concat(n.message,"\n at ? (").concat(t,":").concat(r,")"),i=O(n)||o;y({name:n.name,message:"UnhandledPromiseRejectionWarning: ".concat(n),stack:i})}else{var a="string"==typeof n?n:JSON.stringify(n);y({name:"window.onunhandledrejection",message:"UnhandledPromiseRejectionWarning: ".concat(a)})}}}return function(e){t(e),"function"==typeof n&&n.apply(this,arguments)}}),x=!0,f)n.push(t);if(l("Initializing honeybadger.js "+j),/complete|interactive|loaded/.test(document.readyState))E=!0,l("honeybadger.js 2.0.0 ready");else{l("Installing ready handler");var h=function(){var e;for(E=!0,l("honeybadger.js 2.0.0 ready");e=u.pop();)v(e)};document.addEventListener?document.addEventListener("DOMContentLoaded",h,!0):window.attachEvent("onload",h)}return f}}(),n=e();return n.factory=e,n});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).Honeybadger=n()}(this,function(){"use strict";function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var e=function(){var b,w,j="2.0.1",k={name:"honeybadger.js",url:"https://github.com/honeybadger-io/honeybadger-js",version:j,language:"javascript"},E=!1,x=!1;function _(e,n){var t={};for(var r in e)t[r]=e[r];for(var r in n)t[r]=n[r];return t}function S(e,n){var t=_(e,n);return e.context&&n.context&&(t.context=_(e.context,n.context)),t}function T(e){return!!b&&b.name===e.name&&b.message===e.message&&b.stack===e.stack}function O(e){return e.stacktrace||e.stack||void 0}return function(e){var c=x,n=[],u=[],f={context:{},beforeNotifyHandlers:[],errorsSent:0};if("object"===R(e))for(var t in e)f[t]=e[t];function s(){var e=window.console;if(e){var n=Array.prototype.slice.call(arguments);n.unshift("[Honeybadger]"),e.log.apply(e,n)}}function l(){if(p("debug"))return s.apply(this,arguments)}function p(e,n){var t=f[e];return void 0===t&&(t=f[e.toLowerCase()]),"false"===t&&(t=!1),void 0!==t?t:n}function d(){return!c&&p("onerror",!0)}function r(e,n){try{var t=new XMLHttpRequest;t.open("POST","http"+(p("ssl",!0)?"s":"")+"://"+p("host","api.honeybadger.io")+"/v1/notices/js",p("async",!0)),t.setRequestHeader("X-API-Key",e),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Accept","text/json, application/json"),t.send(JSON.stringify(function e(n,t){var r,o,i,a;if(i={},t||(t=0),t>=p("max_depth",8))return"[MAX DEPTH REACHED]";for(r in n)o=n[r],Object.prototype.hasOwnProperty.call(n,r)&&null!=r&&null!=o&&((/function|symbol/.test(R(a=o))||"object"===R(a)&&void 0===a.hasOwnProperty)&&(o=Object.prototype.toString.call(o)),i[r]="object"===R(o)?e(o,t+1):o);return i}(n)))}catch(e){s("Unable to send error report: error while initializing request",e,n)}}function v(e){if(b=w=null,p("disabled",!1))return l("Dropping notice: honeybadger.js is disabled",e),!1;var n,t=p("apiKey",p("api_key"));return t?(n=p("maxErrors"))&&f.errorsSent>=n?(l("Dropping notice: max errors exceeded",e),!1):(f.errorsSent++,r(t,e),!0):(s("Unable to send error report: no API key has been configured"),!1)}function y(e,n){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var t=e;e=_(e,{name:t.name,message:t.message,stack:O(t)})}if("object"!==R(e)){var r=String(e);e={message:r}}if(T(e))return!1;if(w&&E&&v(w),function(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!1;return!0}(e))return!1;var o;n&&(e.stack=n.stack,o=n.generator);var i=(e=_(e,{name:e.name||"Error",context:_(f.context,e.context),url:e.url||document.URL,projectRoot:e.projectRoot||e.project_root||p("projectRoot",p("project_root",window.location.protocol+"//"+window.location.host)),environment:e.environment||p("environment"),component:e.component||p("component"),action:e.action||p("action"),revision:e.revision||p("revision")})).stack;if(function(e,n){var t,r;for(t=0,r=e.length;t<r;t++)if(!1===(0,e[t])(n))return!0;return!1}(f.beforeNotifyHandlers,e))return!1;if(e.stack!=i&&(o=void 0),function(e,n){var t=e.message;if(!t)return!1;for(var r in n)if(t.match(n[r]))return!0;return!1}(e,p("ignorePatterns")))return!1;var a,c=((a={}).HTTP_USER_AGENT=navigator.userAgent,document.referrer.match(/\S/)&&(a.HTTP_REFERER=document.referrer),a);"string"==typeof e.cookies?c.HTTP_COOKIE=e.cookies:"object"===R(e.cookies)&&(c.HTTP_COOKIE=function(e){if("object"===R(e)){var n=[];for(var t in e)n.push(t+"="+e[t]);return n.join(";")}}(e.cookies));var s={notifier:k,error:{class:e.name,message:e.message,backtrace:e.stack,generator:o,fingerprint:e.fingerprint},request:{url:e.url,component:e.component,action:e.action,context:e.context,cgi_data:c,params:e.params},server:{project_root:e.projectRoot,environment_name:e.environment,revision:e.revision}};return w=s,b=e,E?(l("Deferring notice",e,s),window.setTimeout(function(){T(e)&&v(s)})):(l("Queuing notice",e,s),u.push(s)),e}var o=!0;if(window.atob||(o=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(o=!1)}catch(e){}function i(n,t){try{return"function"!=typeof n?n:(e=n,"function"!=typeof Object.isExtensible||Object.isExtensible(e)?(n.___hb||(n.___hb=function(){var e=d();if(!(o&&(e||t)||t&&!e))return n.apply(this,arguments);try{return n.apply(this,arguments)}catch(e){throw y(e),e}}),n.___hb.___hb=n.___hb,n.___hb):n)}catch(e){return n}var e}f.notify=function(e,n,t){if(e||(e={}),"[object Error]"===Object.prototype.toString.call(e)){var r=e;e=_(e,{name:r.name,message:r.message,stack:O(r)})}return"object"!==R(e)&&(e={message:String(e)}),n&&"object"!==R(n)&&(n={name:String(n)}),n&&(e=S(e,n)),"object"===R(t)&&(e=S(e,t)),y(e,function(e){var n;if(e&&(n=O(e)))return{stack:n,generator:void 0};try{throw new Error("")}catch(e){if(n=O(e))return{stack:n,generator:"throw"}}n=["<call-stack>"];for(var t=arguments.callee;t&&n.length<10;){/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())?n.push(RegExp.$1||"<anonymous>"):n.push("<anonymous>");try{t=t.caller}catch(e){break}}return{stack:n.join("\n"),generator:"walk"}}(e))},f.wrap=function(e){return i(e,!0)},f.setContext=function(e){return"object"===R(e)&&(f.context=_(f.context,e)),f},f.resetContext=function(e){return"object"===R(e)?f.context=_({},e):f.context={},f},f.configure=function(e){for(var n in e)f[n]=e[n];return f},f.beforeNotify=function(e){return f.beforeNotifyHandlers.push(e),f};var a=[].indexOf||function(e){for(var n=0,t=this.length;n<t;n++)if(n in this&&this[n]===e)return n;return-1};function m(e,n,t){if(!c&&e&&n&&t){var r=e[n];e[n]=t(r)}}f.reset=function(){for(var e in f.context={},f.beforeNotifyHandlers=[],f)-1==a.call(n,e)&&(f[e]=void 0);return f.resetMaxErrors(),f},f.resetMaxErrors=function(){return f.errorsSent=0},f.getVersion=function(){return j};var g=function(r){return function(e,n){if("function"!=typeof e)return r(e,n);var t=Array.prototype.slice.call(arguments,2);return e=i(e),r(function(){e.apply(null,t)},n)}};for(var t in m(window,"setTimeout",g),m(window,"setInterval",g),"EventTarget Window Node ApplicationCache AudioTrackList ChannelMergerNode CryptoOperation EventSource FileReader HTMLUnknownElement IDBDatabase IDBRequest IDBTransaction KeyOperation MediaController MessagePort ModalWindow Notification SVGElementInstance Screen TextTrack TextTrackCue TextTrackList WebSocket WebSocketWorker Worker XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload".replace(/\w+/g,function(e){var n=window[e]&&window[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(m(n,"addEventListener",function(o){return function(e,n,t,r){try{n&&null!=n.handleEvent&&(n.handleEvent=i(n.handleEvent))}catch(e){s(e)}return o.call(this,e,i(n),t,r)}}),m(n,"removeEventListener",function(o){return function(e,n,t,r){return o.call(this,e,n,t,r),o.call(this,e,i(n),t,r)}}))}),m(window,"onerror",function(i){return function(e,n,t,r,o){return function(e,n,t,r,o){if(l("window.onerror callback invoked",arguments),!b&&d())if(0===t&&/Script error\.?/.test(e))s("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments);else{var i=[e,"\n at ? (",n||"unknown",":",t||0,":",r||0,")"].join("");if(o){var a={stack:O(o)};return a.stack||(a={stack:i}),y(o,a)}y({name:"window.onerror",message:e,stack:i})}}(e,n,t,r,o),!("function"!=typeof i||!p("_onerror_call_orig",!0))&&i.apply(this,arguments)}}),m(window,"onunhandledrejection",function(n){function t(e){if(l("window.onunhandledrejection callback invoked",arguments),!b&&!c&&p("onunhandledrejection",!0)){var n=e.reason;if(n instanceof Error){var t=n.fileName||"unknown",r=n.lineNumber||0,o="".concat(n.message,"\n at ? (").concat(t,":").concat(r,")"),i=O(n)||o;y({name:n.name,message:"UnhandledPromiseRejectionWarning: ".concat(n),stack:i})}else{var a="string"==typeof n?n:JSON.stringify(n);y({name:"window.onunhandledrejection",message:"UnhandledPromiseRejectionWarning: ".concat(a)})}}}return function(e){t(e),"function"==typeof n&&n.apply(this,arguments)}}),x=!0,f)n.push(t);if(l("Initializing honeybadger.js "+j),/complete|interactive|loaded/.test(document.readyState))E=!0,l("honeybadger.js 2.0.1 ready");else{l("Installing ready handler");var h=function(){var e;for(E=!0,l("honeybadger.js 2.0.1 ready");e=u.pop();)v(e)};document.addEventListener?document.addEventListener("DOMContentLoaded",h,!0):window.attachEvent("onload",h)}return f}}(),n=e();return n.factory=e,n});
//# sourceMappingURL=honeybadger.min.js.map
{
"name": "honeybadger-js",
"description": "A JavaScript library for integrating apps with the Honeybadger Rails Error Notifier.",
"version": "2.0.0",
"version": "2.0.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/honeybadger-io/honeybadger-js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc