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

@honeybadger-io/js

Package Overview
Dependencies
Maintainers
6
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@honeybadger-io/js - npm Package Compare versions

Comparing version 3.0.0-alpha.10 to 3.0.0-alpha.11

3

dist/browser/honeybadger.d.ts

@@ -85,3 +85,4 @@ // Type definitions for honeybadger.js

number: number,
column: number
column: number,
context: string
}

@@ -88,0 +89,0 @@

@@ -221,3 +221,4 @@ (function (global, factory) {

number: line.lineNumber,
column: line.column
column: line.column,
context: 'unknown'
};

@@ -437,3 +438,3 @@ });

url: 'https://github.com/honeybadger-io/honeybadger-js',
version: '3.0.0-alpha.10'
version: '3.0.0-alpha.11'
};

@@ -440,0 +441,0 @@ var Client = /** @class */ (function () {

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Honeybadger=t()}(this,function(){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o="<unknown>";function i(e){return e.split("\n").reduce(function(e,t){t=function(e){var t=a.exec(e);if(!t)return null;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),e=c.exec(t[2]);r&&null!=e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3]);return{file:n?null:t[2],methodName:t[1]||o,arguments:n?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}(t)||function(e){e=s.exec(e);return e?{file:e[2],methodName:e[1]||o,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}(t)||function(e){var t=u.exec(e);if(!t)return null;var n=t[3]&&-1<t[3].indexOf(" > eval"),e=l.exec(t[3]);n&&null!=e&&(t[3]=e[1],t[4]=e[2],t[5]=null);return{file:t[3],methodName:t[1]||o,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}(t)||function(e){e=d.exec(e);return e?{file:e[2],methodName:e[1]||o,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}(t)||function(e){e=f.exec(e);return e?{file:e[3],methodName:e[1]||o,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}(t);return t&&e.push(t),e},[])}var a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/;var s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,l=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;var f=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;var d=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function p(e,t){var n,r={};for(n in e)r[n]=e[n];for(n in t)r[n]=t[n];return r}function h(e,t){var n=p(e,t);return e.context&&t.context&&(n.context=p(e.context,t.context)),n}function g(e,t,n){void 0===n&&(n=void 0);for(var r=0,o=t.length;r<o;r++)t[r](n,e);return 1}function m(e){if("object"!=typeof e)return{};var t,n={};for(t in e)n[t]=e[t];return n}function y(e,c){void 0===c&&(c=8);var s=[];return function t(e,n){if(void 0===n&&(n=0),c<=n)return"[DEPTH]";if(/function|symbol/.test(typeof(r=e))||null===r||"object"==typeof r&&void 0===r.hasOwnProperty)return Object.prototype.toString.call(e);var r;if(function(e){if(e&&"object"==typeof e){for(var t=0;t<s.length;t++)if(s[t]===e)return 1;s.push(e)}}(e))return"[RECURSION]";if(Array.isArray(e))return e.map(function(e){return t(e,n+1)});if("object"!=typeof e)return e;var o,i={};for(o in e){var a=e[o];Object.prototype.hasOwnProperty.call(e,o)&&null!=o&&null!=a&&(i[o]=t(a,n+1))}return i}(e)}function t(o){function e(r){return function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];"debug"===r&&!o.config.debug||(t.unshift("[Honeybadger]"),(e=o.config.logger)[r].apply(e,t))}}return{log:e("log"),info:e("info"),debug:e("debug"),warn:e("warn"),error:e("error")}}function b(e){return e?"[object Error]"===Object.prototype.toString.call(e)?p(e,{name:e.name,message:e.message,stack:e.stack}):"object"==typeof e?m(e):{message:String(e)}:{}}function _(e,t,n){if(e&&t&&n&&t in e){for(var r=e[t];r&&r.__hb_original;)r=r.__hb_original;try{e[t]=n(r),e[t].__hb_original=r}catch(e){}}}var v={name:"honeybadger-js",url:"https://github.com/honeybadger-io/honeybadger-js",version:"3.0.0-alpha.10"},e=(w.prototype.factory=function(e){throw new Error("Must implement __factory in subclass")},w.prototype.getVersion=function(){return v.version},w.prototype.configure=function(e){var t,n=this;for(t in void 0===e&&(e={}),e)this.config[t]=e[t];return this.__pluginsExecuted||(this.__pluginsExecuted=!0,this.config.__plugins.forEach(function(e){return e.load(n)})),this},w.prototype.beforeNotify=function(e){return this.__beforeNotifyHandlers.push(e),this},w.prototype.afterNotify=function(e){return this.__afterNotifyHandlers.push(e),this},w.prototype.setContext=function(e){return"object"==typeof e&&(this.__context=p(this.__context,e)),this},w.prototype.resetContext=function(e){return this.__context="object"==typeof e?p({},e):{},this},w.prototype.notify=function(e,t,n){if(void 0===t&&(t=void 0),void 0===n&&(n=void 0),!this.config.apiKey)return this.logger.warn("Unable to send error report: no API key has been configured"),!1;if(this.config.disabled)return this.logger.warn("Deprecation warning: instead of `disabled: true`, use `reportData: false` to explicitly disable Honeybadger reporting. (Dropping notice: honeybadger.js is disabled)"),!1;if(!this.__reportData())return this.logger.debug("Dropping notice: honeybadger.js is in development mode"),!1;if(e=b(e),t&&"object"!=typeof t&&(t={name:String(t)}),t&&(e=h(e,t)),"object"==typeof n&&(e=h(e,n)),function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return;return 1}(e))return!1;var r,n=0;return"string"==typeof(e=p(e,{name:e.name||"Error",context:p(this.__context,e.context),projectRoot:e.projectRoot||this.config.projectRoot,environment:e.environment||this.config.environment,component:e.component||this.config.component,action:e.action||this.config.action,revision:e.revision||this.config.revision})).stack&&e.stack.trim()||(e.stack=function(){try{throw new Error("")}catch(e){if(e.stack)return e.stack}for(var e=[],t=arguments.callee;t&&e.length<10;){/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())?e.push(RegExp.$1||"<anonymous>"):e.push("<anonymous>");try{t=t.caller}catch(e){break}}return e.join("\n")}(),n=2),e.backtrace=function(e,t){void 0===t&&(t=0);try{var n=i(e).map(function(e){return{file:e.file,method:e.methodName,number:e.lineNumber,column:e.column}});return n.splice(0,t),n}catch(e){return[]}}(e.stack,n),!!function(e,t){for(var n=0,r=t.length;n<r;n++)if(!1===(0,t[n])(e))return;return 1}(e,this.__beforeNotifyHandlers)&&(r=e,n=this.config.ignorePatterns,(!Array.isArray(n)||!n.some(function(e){return e.test(r.message)}))&&(this.addBreadcrumb("Honeybadger Notice",{category:"notice",metadata:{message:e.message,name:e.name,stack:e.stack}}),e.__breadcrumbs=this.config.breadcrumbsEnabled?this.__breadcrumbs.slice():[],this.__send(e)))},w.prototype.addBreadcrumb=function(e,t){if(this.config.breadcrumbsEnabled){var n=m((t=t||{}).metadata),r=t.category||"custom",t=(new Date).toISOString();this.__breadcrumbs.push({category:r,message:e,metadata:n,timestamp:t});t=this.config.maxBreadcrumbs;return this.__breadcrumbs.length>t&&(this.__breadcrumbs=this.__breadcrumbs.slice(this.__breadcrumbs.length-t)),this}},w.prototype.__reportData=function(){return null!==this.config.reportData?this.config.reportData:!(this.config.environment&&this.config.developmentEnvironments.includes(this.config.environment))},w.prototype.__send=function(e){throw new Error("Must implement send in subclass")},w.prototype.__buildPayload=function(e){return{notifier:v,breadcrumbs:{enabled:!!this.config.breadcrumbsEnabled,trail:e.__breadcrumbs||[]},error:{class:e.name,message:e.message,backtrace:e.backtrace,fingerprint:e.fingerprint},request:{url:e.url,component:e.component,action:e.action,context:e.context,cgi_data:e.cgiData||{},params:e.params},server:{project_root:e.projectRoot,environment_name:e.environment,revision:e.revision}}},w);function w(e){void 0===e&&(e={}),this.__pluginsExecuted=!1,this.__context={},this.__breadcrumbs=[],this.__beforeNotifyHandlers=[],this.__afterNotifyHandlers=[],this.config=r({apiKey:null,endpoint:"https://api.honeybadger.io",environment:null,projectRoot:null,component:null,action:null,revision:null,reportData:null,breadcrumbsEnabled:!0,maxBreadcrumbs:40,maxObjectDepth:8,ignorePatterns:[],logger:console,developmentEnvironments:["dev","development","test"],disabled:!1,debug:!1,enableUncaught:!0,enableUnhandledRejection:!0,afterUncaught:function(){return!0},__plugins:[]},e),this.logger=t(this)}function E(n){if(!n||!n.tagName)return"";var r=n.tagName.toLowerCase();if("html"===r)return"";n.id&&(r+="#"+n.id);var e=n.getAttribute("class");e&&e.split(/\s+/).forEach(function(e){r+="."+e}),["alt","name","title","type"].forEach(function(e){var t=n.getAttribute(e);t&&(r+="["+e+'="'+t+'"]')});e=function(t){try{var e=t.parentNode.childNodes,n=[];return Array.prototype.forEach.call(e,function(e){e.tagName&&e.tagName===t.tagName&&n.push(e)}),n}catch(e){return[]}}(n);return 1<e.length&&(r+=":nth-child("+(Array.prototype.indexOf.call(e,n)+1)+")"),r}function x(e){var t=e.textContent||e.innerText||"";return t||"submit"!==e.type&&"button"!==e.type||(t=e.value),function(e,t){e.length>t&&(e=e.substr(0,t)+"...");return e}(t.trim(),300)}function j(e){return-1!==e.toString().indexOf("native")}function k(e){e=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/)||{};return{protocol:e[2],host:e[4],pathname:e[5]}}function N(e){var t=k(e),e=k(document.URL);return!t.host||!t.protocol||t.protocol===e.protocol&&t.host===e.host?t.pathname:t.protocol+"://"+t.host+t.pathname}var T,O,R,S,H,P,A,C,U,q=function(){var e=!0;if(window.atob||(e=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(e=!1)}catch(e){}return e}(),D=0;function L(){this.constructor=R}function B(e){void 0===e&&(e={});var t=O.call(this,r({async:!0,maxErrors:null,projectRoot:window.location.protocol+"//"+window.location.host},e))||this;return t.__errorsSent=0,t.__lastWrapErr=void 0,t.__beforeNotifyHandlers=[function(e){return t.__exceedsMaxErrors()?(t.logger.debug("Dropping notice: max errors exceeded",e),!1):(e.url||(e.url=document.URL),!0)}],t}return new(n(R=B,S=O=e),R.prototype=null===S?Object.create(S):(L.prototype=S.prototype,new L),B.prototype.resetMaxErrors=function(){return this.__errorsSent=0},B.prototype.wrap=function(e){return this.__wrap(e,{catch:!0})},B.prototype.factory=function(e){return new B(e)},B.prototype.__buildPayload=function(e){var t={HTTP_USER_AGENT:void 0,HTTP_REFERER:void 0,HTTP_COOKIE:void 0};t.HTTP_USER_AGENT=navigator.userAgent,document.referrer.match(/\S/)&&(t.HTTP_REFERER=document.referrer),"string"==typeof e.cookies?t.HTTP_COOKIE=e.cookies:"object"==typeof e.cookies&&(t.HTTP_COOKIE=function(e){if("object"==typeof e){var t,n=[];for(t in e)n.push(t+"="+e[t]);return n.join(";")}}(e.cookies));e=O.prototype.__buildPayload.call(this,e);return e.request.cgi_data=p(t,e.request.cgi_data),e},B.prototype.__send=function(t){var e=this;this.__incrementErrorsCount();var n,r,o=this.__buildPayload(t),i=Array.prototype.slice.call(this.__afterNotifyHandlers);t.afterNotify&&i.unshift(t.afterNotify);try{var a=new XMLHttpRequest;a.open("POST",(n=this.config,r="/v1/notices/js",n.endpoint.trim().replace(/\/$/,"")+"/"+(r=r.trim().replace(/(^\/|\/$)/g,""))),this.config.async),a.setRequestHeader("X-API-Key",this.config.apiKey),a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Accept","text/json, application/json"),a.send(JSON.stringify(y(o,this.config.maxObjectDepth))),a.onload=function(){if(201!==a.status)return g(t,i,new Error("Bad HTTP response: "+a.status)),void e.logger.debug("Unable to send error report: "+a.status+": "+a.statusText,a,t);g(p(t,{id:JSON.parse(a.response).id}),i),e.logger.debug("Error report sent",t)}}catch(e){g(t,i,e),this.logger.error("Unable to send error report: error while initializing request",e,t)}return!0},B.prototype.__wrap=function(e,t){void 0===t&&(t={});var n,r,o=e;t=t||{};try{return"function"!=typeof o?o:(r=o,"function"!=typeof Object.isExtensible||Object.isExtensible(r)?(o.___hb||(n=this,o.___hb=function(){var e=n.config.enableUncaught;if(!t.catch&&!q&&e)return o.apply(this,arguments);try{return o.apply(this,arguments)}catch(e){if(n.__lastWrapErr===e)throw e;throw n.__lastWrapErr=e,D+=1,clearTimeout(T),T=setTimeout(function(){D=0}),n.addBreadcrumb(t.component?t.component+": "+e.name:e.name,{category:"error",metadata:{message:e.message,name:e.name,stack:e.stack}}),n.notify(e),e}}),o.___hb.___hb=o.___hb,o.___hb):o)}catch(e){return o}},B.prototype.__incrementErrorsCount=function(){return this.__errorsSent++},B.prototype.__exceedsMaxErrors=function(){return this.config.maxErrors&&this.__errorsSent>=this.config.maxErrors},B)({__plugins:[(void 0===U&&(U=window),{load:function(a){_(U,"onerror",function(i){return function(e,t,n,r,o){return function(e,t,n,r,o){if(a.logger.debug("window.onerror callback invoked",arguments),0<D)return a.logger.debug("Ignoring window.onerror (error likely reported earlier)",arguments),--D;a.config.enableUncaught&&(0===n&&/Script error\.?/.test(e)?a.logger.info("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments):((o=b(o)).name||(o.name="window.onerror"),o.message||(o.message=e),o.stack||(o.stack=[o.message,"\n at ? (",t||"unknown",":",n||0,":",r||0,")"].join("")),a.addBreadcrumb("window.onerror"!==o.name&&o.name?"window.onerror: "+o.name:"window.onerror",{category:"error",metadata:{name:o.name,message:o.message,stack:o.stack}}),a.notify(o)))}(e,t,n,r,o),"function"==typeof i&&i.apply(window,arguments)}})}}),(void 0===C&&(C=window),{load:function(n){n.config.enableUnhandledRejection&&_(C,"onunhandledrejection",function(t){return function(e){!function(e){if(n.logger.debug("window.onunhandledrejection callback invoked",arguments),n.config.enableUnhandledRejection){var t=e.reason;if(t instanceof Error){e=t.message+"\n at ? (unknown:0)",e=t.stack||e,e={name:t.name,message:"UnhandledPromiseRejectionWarning: "+t,stack:e};return n.addBreadcrumb("window.onunhandledrejection: "+e.name,{category:"error",metadata:e}),n.notify(e)}t="string"==typeof t?t:JSON.stringify(t);n.notify({name:"window.onunhandledrejection",message:"UnhandledPromiseRejectionWarning: "+t})}}(e),"function"==typeof t&&t.apply(this,arguments)}})}}),(void 0===A&&(A=window),{load:function(i){function e(o){return function(r){return function(e,t){if("function"!=typeof e)return r(e,t);var n=Array.prototype.slice.call(arguments,2);return e=i.__wrap(e,o),r(function(){e.apply(void 0,n)},t)}}}_(A,"setTimeout",e({component:"setTimeout"})),_(A,"setInterval",e({component:"setInterval"}))}}),(void 0===P&&(P=window),{load:function(a){["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"].forEach(function(e){var t=P[e]&&P[e].prototype;t&&Object.prototype.hasOwnProperty.call(t,"addEventListener")&&(_(t,"addEventListener",function(o){var i={component:e+".prototype.addEventListener"};return function(e,t,n,r){try{t&&null!=t.handleEvent&&(t.handleEvent=a.__wrap(t.handleEvent,i))}catch(e){a.logger.error(e)}return o.call(this,e,a.__wrap(t,i),n,r)}}),_(t,"removeEventListener",function(o){return function(e,t,n,r){return o.call(this,e,t,n,r),o.call(this,e,a.__wrap(t),n,r)}}))})}}),(void 0===H&&(H=window),{load:function(a){function e(e){return!0===a.config.breadcrumbsEnabled||(e?!0===a.config.breadcrumbsEnabled[e]:!1!==a.config.breadcrumbsEnabled)}function n(e,t){r=t,a.addBreadcrumb("Page changed",{category:"navigation",metadata:{from:e,to:t}})}function t(t){return function(){var e=2<arguments.length?arguments[2]:void 0;return e&&n(r,String(e)),t.apply(this,arguments)}}var r;e("console")&&["debug","info","warn","error","log"].forEach(function(r){_(H.console,r,function(n){return function(){var e,t=Array.prototype.slice.call(arguments),e=(e=t,Array.isArray(e)?e.map(function(e){try{return String(e)}catch(e){return"[unknown]"}}).join(" "):""),t={category:"log",metadata:{level:r,arguments:y(t,3)}};a.addBreadcrumb(e,t),"function"==typeof n&&Function.prototype.apply.call(n,H.console,arguments)}})}),e("dom")&&H.addEventListener("click",function(e){var t,n,r;try{t=E(e.target),n=function e(t){var n=E(t);if(t.parentNode&&t.parentNode.tagName&&0<(t=e(t.parentNode)).length)return t+" > "+n;return n}(e.target),r=x(e.target)}catch(e){t="UI Click",r=n="[unknown]"}0!==t.length&&a.addBreadcrumb(t,{category:"ui.click",metadata:{selector:n,text:r,event:e}})},!0),e("network")&&(_(XMLHttpRequest.prototype,"open",function(r){return function(){var e=arguments[1],t="string"==typeof arguments[0]?arguments[0].toUpperCase():arguments[0],n=t+" "+N(e);this.__hb_xhr={type:"xhr",method:t,url:e,message:n},"function"==typeof r&&r.apply(this,arguments)}}),_(XMLHttpRequest.prototype,"send",function(e){return function(){var t=this;function n(){var e;4===t.readyState&&(e=void 0,t.__hb_xhr&&(t.__hb_xhr.status_code=t.status,e=t.__hb_xhr.message,delete t.__hb_xhr.message),a.addBreadcrumb(e||"XMLHttpRequest",{category:"request",metadata:t.__hb_xhr}))}"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?_(t,"onreadystatechange",function(e){return function(){n(),"function"==typeof e&&e.apply(this,arguments)}}):t.onreadystatechange=n,"function"==typeof e&&e.apply(t,arguments)}})),!e("network")||function(){if(window.fetch){if(j(window.fetch))return 1;try{var e=document.createElement("iframe");e.style.display="none",document.head.appendChild(e);var t=e.contentWindow.fetch&&j(e.contentWindow.fetch);return document.head.removeChild(e),t}catch(e){console&&console.warn&&console.warn("failed to detect native fetch via iframe: "+e)}}}()&&_(H,"fetch",function(i){return function(){var e,t=arguments[0],n="GET";"string"==typeof t?e=t:"Request"in H&&t instanceof Request?(e=t.url,t.method&&(n=t.method)):e=String(t),arguments[1]&&arguments[1].method&&(n=arguments[1].method),"string"==typeof n&&(n=n.toUpperCase());var r=n+" "+N(e),o={type:"fetch",method:n,url:e};return i.apply(this,arguments).then(function(e){return o.status_code=e.status,a.addBreadcrumb(r,{category:"request",metadata:o}),e}).catch(function(e){throw a.addBreadcrumb("fetch error",{category:"error",metadata:o}),e})}}),e("navigation")&&(r=H.location.href,_(H,"onpopstate",function(e){return function(){if(n(r,H.location.href),e)return e.apply(this,arguments)}}),_(H.history,"pushState",t),_(H.history,"replaceState",t))}})]})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Honeybadger=e()}(this,function(){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o="<unknown>";function i(t){return t.split("\n").reduce(function(t,e){e=function(t){var e=a.exec(t);if(!e)return null;var n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),t=c.exec(e[2]);r&&null!=t&&(e[2]=t[1],e[3]=t[2],e[4]=t[3]);return{file:n?null:e[2],methodName:e[1]||o,arguments:n?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}(e)||function(t){t=s.exec(t);return t?{file:t[2],methodName:t[1]||o,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}(e)||function(t){var e=u.exec(t);if(!e)return null;var n=e[3]&&-1<e[3].indexOf(" > eval"),t=l.exec(e[3]);n&&null!=t&&(e[3]=t[1],e[4]=t[2],e[5]=null);return{file:e[3],methodName:e[1]||o,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}(e)||function(t){t=d.exec(t);return t?{file:t[2],methodName:t[1]||o,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}(e)||function(t){t=f.exec(t);return t?{file:t[3],methodName:t[1]||o,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}(e);return e&&t.push(e),t},[])}var a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/;var s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,l=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;var f=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;var d=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function p(t,e){var n,r={};for(n in t)r[n]=t[n];for(n in e)r[n]=e[n];return r}function h(t,e){var n=p(t,e);return t.context&&e.context&&(n.context=p(t.context,e.context)),n}function g(t,e,n){void 0===n&&(n=void 0);for(var r=0,o=e.length;r<o;r++)e[r](n,t);return 1}function m(t){if("object"!=typeof t)return{};var e,n={};for(e in t)n[e]=t[e];return n}function y(t,c){void 0===c&&(c=8);var s=[];return function e(t,n){if(void 0===n&&(n=0),c<=n)return"[DEPTH]";if(/function|symbol/.test(typeof(r=t))||null===r||"object"==typeof r&&void 0===r.hasOwnProperty)return Object.prototype.toString.call(t);var r;if(function(t){if(t&&"object"==typeof t){for(var e=0;e<s.length;e++)if(s[e]===t)return 1;s.push(t)}}(t))return"[RECURSION]";if(Array.isArray(t))return t.map(function(t){return e(t,n+1)});if("object"!=typeof t)return t;var o,i={};for(o in t){var a=t[o];Object.prototype.hasOwnProperty.call(t,o)&&null!=o&&null!=a&&(i[o]=e(a,n+1))}return i}(t)}function e(o){function t(r){return function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];"debug"===r&&!o.config.debug||(e.unshift("[Honeybadger]"),(t=o.config.logger)[r].apply(t,e))}}return{log:t("log"),info:t("info"),debug:t("debug"),warn:t("warn"),error:t("error")}}function b(t){return t?"[object Error]"===Object.prototype.toString.call(t)?p(t,{name:t.name,message:t.message,stack:t.stack}):"object"==typeof t?m(t):{message:String(t)}:{}}function _(t,e,n){if(t&&e&&n&&e in t){for(var r=t[e];r&&r.__hb_original;)r=r.__hb_original;try{t[e]=n(r),t[e].__hb_original=r}catch(t){}}}var v={name:"honeybadger-js",url:"https://github.com/honeybadger-io/honeybadger-js",version:"3.0.0-alpha.11"},t=(w.prototype.factory=function(t){throw new Error("Must implement __factory in subclass")},w.prototype.getVersion=function(){return v.version},w.prototype.configure=function(t){var e,n=this;for(e in void 0===t&&(t={}),t)this.config[e]=t[e];return this.__pluginsExecuted||(this.__pluginsExecuted=!0,this.config.__plugins.forEach(function(t){return t.load(n)})),this},w.prototype.beforeNotify=function(t){return this.__beforeNotifyHandlers.push(t),this},w.prototype.afterNotify=function(t){return this.__afterNotifyHandlers.push(t),this},w.prototype.setContext=function(t){return"object"==typeof t&&(this.__context=p(this.__context,t)),this},w.prototype.resetContext=function(t){return this.__context="object"==typeof t?p({},t):{},this},w.prototype.notify=function(t,e,n){if(void 0===e&&(e=void 0),void 0===n&&(n=void 0),!this.config.apiKey)return this.logger.warn("Unable to send error report: no API key has been configured"),!1;if(this.config.disabled)return this.logger.warn("Deprecation warning: instead of `disabled: true`, use `reportData: false` to explicitly disable Honeybadger reporting. (Dropping notice: honeybadger.js is disabled)"),!1;if(!this.__reportData())return this.logger.debug("Dropping notice: honeybadger.js is in development mode"),!1;if(t=b(t),e&&"object"!=typeof e&&(e={name:String(e)}),e&&(t=h(t,e)),"object"==typeof n&&(t=h(t,n)),function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return;return 1}(t))return!1;var r,n=0;return"string"==typeof(t=p(t,{name:t.name||"Error",context:p(this.__context,t.context),projectRoot:t.projectRoot||this.config.projectRoot,environment:t.environment||this.config.environment,component:t.component||this.config.component,action:t.action||this.config.action,revision:t.revision||this.config.revision})).stack&&t.stack.trim()||(t.stack=function(){try{throw new Error("")}catch(t){if(t.stack)return t.stack}for(var t=[],e=arguments.callee;e&&t.length<10;){/function(?:\s+([\w$]+))+\s*\(/.test(e.toString())?t.push(RegExp.$1||"<anonymous>"):t.push("<anonymous>");try{e=e.caller}catch(t){break}}return t.join("\n")}(),n=2),t.backtrace=function(t,e){void 0===e&&(e=0);try{var n=i(t).map(function(t){return{file:t.file,method:t.methodName,number:t.lineNumber,column:t.column,context:"unknown"}});return n.splice(0,e),n}catch(t){return[]}}(t.stack,n),!!function(t,e){for(var n=0,r=e.length;n<r;n++)if(!1===(0,e[n])(t))return;return 1}(t,this.__beforeNotifyHandlers)&&(r=t,n=this.config.ignorePatterns,(!Array.isArray(n)||!n.some(function(t){return t.test(r.message)}))&&(this.addBreadcrumb("Honeybadger Notice",{category:"notice",metadata:{message:t.message,name:t.name,stack:t.stack}}),t.__breadcrumbs=this.config.breadcrumbsEnabled?this.__breadcrumbs.slice():[],this.__send(t)))},w.prototype.addBreadcrumb=function(t,e){if(this.config.breadcrumbsEnabled){var n=m((e=e||{}).metadata),r=e.category||"custom",e=(new Date).toISOString();this.__breadcrumbs.push({category:r,message:t,metadata:n,timestamp:e});e=this.config.maxBreadcrumbs;return this.__breadcrumbs.length>e&&(this.__breadcrumbs=this.__breadcrumbs.slice(this.__breadcrumbs.length-e)),this}},w.prototype.__reportData=function(){return null!==this.config.reportData?this.config.reportData:!(this.config.environment&&this.config.developmentEnvironments.includes(this.config.environment))},w.prototype.__send=function(t){throw new Error("Must implement send in subclass")},w.prototype.__buildPayload=function(t){return{notifier:v,breadcrumbs:{enabled:!!this.config.breadcrumbsEnabled,trail:t.__breadcrumbs||[]},error:{class:t.name,message:t.message,backtrace:t.backtrace,fingerprint:t.fingerprint},request:{url:t.url,component:t.component,action:t.action,context:t.context,cgi_data:t.cgiData||{},params:t.params},server:{project_root:t.projectRoot,environment_name:t.environment,revision:t.revision}}},w);function w(t){void 0===t&&(t={}),this.__pluginsExecuted=!1,this.__context={},this.__breadcrumbs=[],this.__beforeNotifyHandlers=[],this.__afterNotifyHandlers=[],this.config=r({apiKey:null,endpoint:"https://api.honeybadger.io",environment:null,projectRoot:null,component:null,action:null,revision:null,reportData:null,breadcrumbsEnabled:!0,maxBreadcrumbs:40,maxObjectDepth:8,ignorePatterns:[],logger:console,developmentEnvironments:["dev","development","test"],disabled:!1,debug:!1,enableUncaught:!0,enableUnhandledRejection:!0,afterUncaught:function(){return!0},__plugins:[]},t),this.logger=e(this)}function E(n){if(!n||!n.tagName)return"";var r=n.tagName.toLowerCase();if("html"===r)return"";n.id&&(r+="#"+n.id);var t=n.getAttribute("class");t&&t.split(/\s+/).forEach(function(t){r+="."+t}),["alt","name","title","type"].forEach(function(t){var e=n.getAttribute(t);e&&(r+="["+t+'="'+e+'"]')});t=function(e){try{var t=e.parentNode.childNodes,n=[];return Array.prototype.forEach.call(t,function(t){t.tagName&&t.tagName===e.tagName&&n.push(t)}),n}catch(t){return[]}}(n);return 1<t.length&&(r+=":nth-child("+(Array.prototype.indexOf.call(t,n)+1)+")"),r}function x(t){var e=t.textContent||t.innerText||"";return e||"submit"!==t.type&&"button"!==t.type||(e=t.value),function(t,e){t.length>e&&(t=t.substr(0,e)+"...");return t}(e.trim(),300)}function j(t){return-1!==t.toString().indexOf("native")}function k(t){t=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/)||{};return{protocol:t[2],host:t[4],pathname:t[5]}}function N(t){var e=k(t),t=k(document.URL);return!e.host||!e.protocol||e.protocol===t.protocol&&e.host===t.host?e.pathname:e.protocol+"://"+e.host+e.pathname}var T,O,R,S,H,P,A,C,U,q=function(){var t=!0;if(window.atob||(t=!1),window.ErrorEvent)try{0===new window.ErrorEvent("").colno&&(t=!1)}catch(t){}return t}(),D=0;function L(){this.constructor=R}function B(t){void 0===t&&(t={});var e=O.call(this,r({async:!0,maxErrors:null,projectRoot:window.location.protocol+"//"+window.location.host},t))||this;return e.__errorsSent=0,e.__lastWrapErr=void 0,e.__beforeNotifyHandlers=[function(t){return e.__exceedsMaxErrors()?(e.logger.debug("Dropping notice: max errors exceeded",t),!1):(t.url||(t.url=document.URL),!0)}],e}return new(n(R=B,S=O=t),R.prototype=null===S?Object.create(S):(L.prototype=S.prototype,new L),B.prototype.resetMaxErrors=function(){return this.__errorsSent=0},B.prototype.wrap=function(t){return this.__wrap(t,{catch:!0})},B.prototype.factory=function(t){return new B(t)},B.prototype.__buildPayload=function(t){var e={HTTP_USER_AGENT:void 0,HTTP_REFERER:void 0,HTTP_COOKIE:void 0};e.HTTP_USER_AGENT=navigator.userAgent,document.referrer.match(/\S/)&&(e.HTTP_REFERER=document.referrer),"string"==typeof t.cookies?e.HTTP_COOKIE=t.cookies:"object"==typeof t.cookies&&(e.HTTP_COOKIE=function(t){if("object"==typeof t){var e,n=[];for(e in t)n.push(e+"="+t[e]);return n.join(";")}}(t.cookies));t=O.prototype.__buildPayload.call(this,t);return t.request.cgi_data=p(e,t.request.cgi_data),t},B.prototype.__send=function(e){var t=this;this.__incrementErrorsCount();var n,r,o=this.__buildPayload(e),i=Array.prototype.slice.call(this.__afterNotifyHandlers);e.afterNotify&&i.unshift(e.afterNotify);try{var a=new XMLHttpRequest;a.open("POST",(n=this.config,r="/v1/notices/js",n.endpoint.trim().replace(/\/$/,"")+"/"+(r=r.trim().replace(/(^\/|\/$)/g,""))),this.config.async),a.setRequestHeader("X-API-Key",this.config.apiKey),a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Accept","text/json, application/json"),a.send(JSON.stringify(y(o,this.config.maxObjectDepth))),a.onload=function(){if(201!==a.status)return g(e,i,new Error("Bad HTTP response: "+a.status)),void t.logger.debug("Unable to send error report: "+a.status+": "+a.statusText,a,e);g(p(e,{id:JSON.parse(a.response).id}),i),t.logger.debug("Error report sent",e)}}catch(t){g(e,i,t),this.logger.error("Unable to send error report: error while initializing request",t,e)}return!0},B.prototype.__wrap=function(t,e){void 0===e&&(e={});var n,r,o=t;e=e||{};try{return"function"!=typeof o?o:(r=o,"function"!=typeof Object.isExtensible||Object.isExtensible(r)?(o.___hb||(n=this,o.___hb=function(){var t=n.config.enableUncaught;if(!e.catch&&!q&&t)return o.apply(this,arguments);try{return o.apply(this,arguments)}catch(t){if(n.__lastWrapErr===t)throw t;throw n.__lastWrapErr=t,D+=1,clearTimeout(T),T=setTimeout(function(){D=0}),n.addBreadcrumb(e.component?e.component+": "+t.name:t.name,{category:"error",metadata:{message:t.message,name:t.name,stack:t.stack}}),n.notify(t),t}}),o.___hb.___hb=o.___hb,o.___hb):o)}catch(t){return o}},B.prototype.__incrementErrorsCount=function(){return this.__errorsSent++},B.prototype.__exceedsMaxErrors=function(){return this.config.maxErrors&&this.__errorsSent>=this.config.maxErrors},B)({__plugins:[(void 0===U&&(U=window),{load:function(a){_(U,"onerror",function(i){return function(t,e,n,r,o){return function(t,e,n,r,o){if(a.logger.debug("window.onerror callback invoked",arguments),0<D)return a.logger.debug("Ignoring window.onerror (error likely reported earlier)",arguments),--D;a.config.enableUncaught&&(0===n&&/Script error\.?/.test(t)?a.logger.info("Ignoring cross-domain script error: enable CORS to track these types of errors",arguments):((o=b(o)).name||(o.name="window.onerror"),o.message||(o.message=t),o.stack||(o.stack=[o.message,"\n at ? (",e||"unknown",":",n||0,":",r||0,")"].join("")),a.addBreadcrumb("window.onerror"!==o.name&&o.name?"window.onerror: "+o.name:"window.onerror",{category:"error",metadata:{name:o.name,message:o.message,stack:o.stack}}),a.notify(o)))}(t,e,n,r,o),"function"==typeof i&&i.apply(window,arguments)}})}}),(void 0===C&&(C=window),{load:function(n){n.config.enableUnhandledRejection&&_(C,"onunhandledrejection",function(e){return function(t){!function(t){if(n.logger.debug("window.onunhandledrejection callback invoked",arguments),n.config.enableUnhandledRejection){var e=t.reason;if(e instanceof Error){t=e.message+"\n at ? (unknown:0)",t=e.stack||t,t={name:e.name,message:"UnhandledPromiseRejectionWarning: "+e,stack:t};return n.addBreadcrumb("window.onunhandledrejection: "+t.name,{category:"error",metadata:t}),n.notify(t)}e="string"==typeof e?e:JSON.stringify(e);n.notify({name:"window.onunhandledrejection",message:"UnhandledPromiseRejectionWarning: "+e})}}(t),"function"==typeof e&&e.apply(this,arguments)}})}}),(void 0===A&&(A=window),{load:function(i){function t(o){return function(r){return function(t,e){if("function"!=typeof t)return r(t,e);var n=Array.prototype.slice.call(arguments,2);return t=i.__wrap(t,o),r(function(){t.apply(void 0,n)},e)}}}_(A,"setTimeout",t({component:"setTimeout"})),_(A,"setInterval",t({component:"setInterval"}))}}),(void 0===P&&(P=window),{load:function(a){["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"].forEach(function(t){var e=P[t]&&P[t].prototype;e&&Object.prototype.hasOwnProperty.call(e,"addEventListener")&&(_(e,"addEventListener",function(o){var i={component:t+".prototype.addEventListener"};return function(t,e,n,r){try{e&&null!=e.handleEvent&&(e.handleEvent=a.__wrap(e.handleEvent,i))}catch(t){a.logger.error(t)}return o.call(this,t,a.__wrap(e,i),n,r)}}),_(e,"removeEventListener",function(o){return function(t,e,n,r){return o.call(this,t,e,n,r),o.call(this,t,a.__wrap(e),n,r)}}))})}}),(void 0===H&&(H=window),{load:function(a){function t(t){return!0===a.config.breadcrumbsEnabled||(t?!0===a.config.breadcrumbsEnabled[t]:!1!==a.config.breadcrumbsEnabled)}function n(t,e){r=e,a.addBreadcrumb("Page changed",{category:"navigation",metadata:{from:t,to:e}})}function e(e){return function(){var t=2<arguments.length?arguments[2]:void 0;return t&&n(r,String(t)),e.apply(this,arguments)}}var r;t("console")&&["debug","info","warn","error","log"].forEach(function(r){_(H.console,r,function(n){return function(){var t,e=Array.prototype.slice.call(arguments),t=(t=e,Array.isArray(t)?t.map(function(t){try{return String(t)}catch(t){return"[unknown]"}}).join(" "):""),e={category:"log",metadata:{level:r,arguments:y(e,3)}};a.addBreadcrumb(t,e),"function"==typeof n&&Function.prototype.apply.call(n,H.console,arguments)}})}),t("dom")&&H.addEventListener("click",function(t){var e,n,r;try{e=E(t.target),n=function t(e){var n=E(e);if(e.parentNode&&e.parentNode.tagName&&0<(e=t(e.parentNode)).length)return e+" > "+n;return n}(t.target),r=x(t.target)}catch(t){e="UI Click",r=n="[unknown]"}0!==e.length&&a.addBreadcrumb(e,{category:"ui.click",metadata:{selector:n,text:r,event:t}})},!0),t("network")&&(_(XMLHttpRequest.prototype,"open",function(r){return function(){var t=arguments[1],e="string"==typeof arguments[0]?arguments[0].toUpperCase():arguments[0],n=e+" "+N(t);this.__hb_xhr={type:"xhr",method:e,url:t,message:n},"function"==typeof r&&r.apply(this,arguments)}}),_(XMLHttpRequest.prototype,"send",function(t){return function(){var e=this;function n(){var t;4===e.readyState&&(t=void 0,e.__hb_xhr&&(e.__hb_xhr.status_code=e.status,t=e.__hb_xhr.message,delete e.__hb_xhr.message),a.addBreadcrumb(t||"XMLHttpRequest",{category:"request",metadata:e.__hb_xhr}))}"onreadystatechange"in e&&"function"==typeof e.onreadystatechange?_(e,"onreadystatechange",function(t){return function(){n(),"function"==typeof t&&t.apply(this,arguments)}}):e.onreadystatechange=n,"function"==typeof t&&t.apply(e,arguments)}})),!t("network")||function(){if(window.fetch){if(j(window.fetch))return 1;try{var t=document.createElement("iframe");t.style.display="none",document.head.appendChild(t);var e=t.contentWindow.fetch&&j(t.contentWindow.fetch);return document.head.removeChild(t),e}catch(t){console&&console.warn&&console.warn("failed to detect native fetch via iframe: "+t)}}}()&&_(H,"fetch",function(i){return function(){var t,e=arguments[0],n="GET";"string"==typeof e?t=e:"Request"in H&&e instanceof Request?(t=e.url,e.method&&(n=e.method)):t=String(e),arguments[1]&&arguments[1].method&&(n=arguments[1].method),"string"==typeof n&&(n=n.toUpperCase());var r=n+" "+N(t),o={type:"fetch",method:n,url:t};return i.apply(this,arguments).then(function(t){return o.status_code=t.status,a.addBreadcrumb(r,{category:"request",metadata:o}),t}).catch(function(t){throw a.addBreadcrumb("fetch error",{category:"error",metadata:o}),t})}}),t("navigation")&&(r=H.location.href,_(H,"onpopstate",function(t){return function(){if(n(r,H.location.href),t)return t.apply(this,arguments)}}),_(H.history,"pushState",e),_(H.history,"replaceState",e))}})]})});
//# sourceMappingURL=honeybadger.min.js.map

@@ -85,3 +85,4 @@ // Type definitions for honeybadger.js

number: number,
column: number
column: number,
context: string
}

@@ -88,0 +89,0 @@

@@ -6,2 +6,3 @@ 'use strict';

var url = require('url');
var domain = require('domain');

@@ -12,2 +13,4 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
var url__default = /*#__PURE__*/_interopDefaultLegacy(url);
var domain__default = /*#__PURE__*/_interopDefaultLegacy(domain);

@@ -222,3 +225,4 @@ /*! *****************************************************************************

number: line.lineNumber,
column: line.column
column: line.column,
context: 'unknown'
};

@@ -413,3 +417,3 @@ });

url: 'https://github.com/honeybadger-io/honeybadger-js',
version: '3.0.0-alpha.10'
version: '3.0.0-alpha.11'
};

@@ -640,2 +644,56 @@ var Client = /** @class */ (function () {

function fullUrl(req) {
var connection = req.connection;
var address = connection && connection.address();
var port = address ? address.port : undefined;
return url__default['default'].format({
protocol: req.protocol,
hostname: req.hostname,
port: port,
pathname: req.path,
query: req.query
});
}
function requestHandler(req, res, next) {
var dom = domain__default['default'].create();
dom.on('error', next);
dom.run(next);
}
function errorHandler(err, req, _res, next) {
this.notify(err, {
url: fullUrl(req),
params: req.body,
session: req.session,
headers: req.headers,
cgiData: {
REQUEST_METHOD: req.method
}
});
return next(err);
}
function lambdaHandler(handler) {
return function lambdaHandler(event, context, callback) {
// eslint-disable-next-line prefer-rest-params
var args = arguments;
var dom = domain__default['default'].create();
// eslint-disable-next-line @typescript-eslint/no-this-alias
var hb = this;
dom.on('error', function (err) {
hb.notify(err, function () {
callback(err);
});
});
dom.run(function () {
process.nextTick(function () {
Promise.resolve(handler.apply(this, args))
.catch(function (err) {
hb.notify(err, function () {
callback(err);
});
});
});
});
}.bind(this);
}
var Honeybadger = /** @class */ (function (_super) {

@@ -645,3 +703,26 @@ __extends(Honeybadger, _super);

if (opts === void 0) { opts = {}; }
return _super.call(this, __assign({ afterUncaught: fatallyLogAndExit }, opts)) || this;
var _this = _super.call(this, __assign({ afterUncaught: fatallyLogAndExit, projectRoot: process.cwd() }, opts)) || this;
_this.__beforeNotifyHandlers = [
function (notice) {
notice.backtrace.forEach(function (line) {
var _a;
if (line.file) {
if ((_a = line.file) === null || _a === void 0 ? void 0 : _a.match(notice.projectRoot)) {
line.context = 'app';
}
else if (/node_modules/.test(line.file)) {
line.context = 'dependency';
}
else {
line.context = 'all';
}
}
return line;
});
}
];
_this.errorHandler = errorHandler.bind(_this);
_this.requestHandler = requestHandler.bind(_this);
_this.lambdaHandler = lambdaHandler.bind(_this);
return _this;
}

@@ -648,0 +729,0 @@ Honeybadger.prototype.factory = function (opts) {

@@ -85,3 +85,4 @@ // Type definitions for honeybadger.js

number: number,
column: number
column: number,
context: string
}

@@ -88,0 +89,0 @@

{
"name": "@honeybadger-io/js",
"version": "3.0.0-alpha.10",
"version": "3.0.0-alpha.11",
"license": "MIT",

@@ -47,5 +47,5 @@ "homepage": "https://github.com/honeybadger-io/honeybadger-js",

"devDependencies": {
"@rollup/plugin-node-resolve": "^8.1.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-typescript": "^5.0.2",
"@rollup/plugin-typescript": "^8.0.0",
"@types/jest": "^26.0.13",

@@ -59,2 +59,3 @@ "@typescript-eslint/eslint-plugin": "^4.7.0",

"eslint-plugin-promise": "^4.2.1",
"express": "^4.17.1",
"jest": "^26.4.2",

@@ -66,4 +67,5 @@ "nock": "^13.0.5",

"sinon": "^9.0.2",
"supertest": "^6.0.1",
"ts-jest": "^26.4.4",
"tsd": "^0.13.1",
"tsd": "^0.14.0",
"typescript": "^4.0.2"

@@ -70,0 +72,0 @@ },

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