Socket
Socket
Sign inDemoInstall

rollbar

Package Overview
Dependencies
Maintainers
7
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollbar - npm Package Compare versions

Comparing version 2.14.4 to 2.15.0

.github/workflows/workflow.yml

5

browserstack.browsers.js

@@ -42,3 +42,3 @@ var request = require('request');

} catch (e) {
console.error('Could not read ./browserstack.browsers.json. Ignoring.', e);
console.error('Could not read ./browserstack.browsers.json. Ignoring.', e); // eslint-disable-line no-console
}

@@ -113,3 +113,4 @@

fs.writeFile('./browserstack.browsers.json', JSON.stringify(body, null, ' '), callback);
// TODO: Fix? fs is not defined here.
// fs.writeFile('./browserstack.browsers.json', JSON.stringify(body, null, ' '), callback);
});

@@ -116,0 +117,0 @@ }

2

defaults.js

@@ -15,5 +15,5 @@ var pkg = require('./package.json');

__DEFAULT_UNCAUGHT_ERROR_LEVEL: JSON.stringify(pkg.defaults.uncaughtErrorLevel),
__DEFAULT_ROLLBARJS_URL__: JSON.stringify('https://' + pkg.cdn.host + '/ajax/libs/rollbar.js/' + version + '/rollbar.min.js'),
__DEFAULT_ROLLBARJS_URL__: JSON.stringify('https://' + pkg.cdn.host + '/rollbarjs/refs/tags/v' + version + '/rollbar.min.js'),
__DEFAULT_MAX_ITEMS__: pkg.defaults.maxItems,
__DEFAULT_ITEMS_PER_MIN__: pkg.defaults.itemsPerMin
};

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

!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";!function(e,r,t){var n=r.Rollbar;if(n){n.configure({payload:{notifier:{plugins:{jquery:{version:"0.0.8"}}}}});var o=function(e){if(n.error(e),r.console){var t="[reported to Rollbar]";n.options&&!n.options.enabled&&(t="[Rollbar not enabled]"),r.console.log(e.message+" "+t)}};e(t).ajaxError(function(e,r,t,o){var u=r.status,a=t.url,i=t.type;if(u){var l={status:u,url:a,type:i,isAjax:!0,data:t.data,jqXHR_responseText:r.responseText,jqXHR_statusText:r.statusText},f=o||"jQuery ajax error for "+i;n.warning(f,l)}});var u=e.fn.ready;e.fn.ready=function(e){return u.call(this,function(r){try{e(r)}catch(e){o(e)}})};var a=e.event.add;e.event.add=function(r,t,n,u,i){var l,f=function(e){return function(){try{return e.apply(this,arguments)}catch(e){o(e)}}};return n.handler?(l=n.handler,n.handler=f(n.handler)):(l=n,n=f(n)),l.guid?n.guid=l.guid:n.guid=l.guid=e.guid++,a.call(this,r,t,n,u,i)}}}(jQuery,window,document)}]);
!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";!function(e,r,t){var n=r.Rollbar;if(n){n.configure({payload:{notifier:{plugins:{jquery:{version:"0.0.8"}}}}});var o=function(e){if(n.error(e),r.console){var t="[reported to Rollbar]";n.options&&!n.options.enabled&&(t="[Rollbar not enabled]"),r.console.log(e.message+" "+t)}};e(t).ajaxError((function(e,r,t,o){var u=r.status,a=t.url,i=t.type;if(u){var l={status:u,url:a,type:i,isAjax:!0,data:t.data,jqXHR_responseText:r.responseText,jqXHR_statusText:r.statusText},f=o||"jQuery ajax error for "+i;n.warning(f,l)}}));var u=e.fn.ready;e.fn.ready=function(e){return u.call(this,(function(r){try{e(r)}catch(e){o(e)}}))};var a=e.event.add;e.event.add=function(r,t,n,u,i){var l,f=function(e){return function(){try{return e.apply(this,arguments)}catch(e){o(e)}}};return n.handler?(l=n.handler,n.handler=f(n.handler)):(l=n,n=f(n)),l.guid?n.guid=l.guid:n.guid=l.guid=e.guid++,a.call(this,r,t,n,u,i)}}}(jQuery,window,document)}]);

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

!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.13.0/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),s=function(r,e){return new l(r,e)},d=function(r){return new i(s,r)};function c(r){return t(function(){var e=Array.prototype.slice.call(arguments,0),o={shim:this,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(o)})}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i<t.length;++i)if("function"==typeof(l=t[i])){l(e);break}}"function"==typeof a&&a(e)}()}}),d.insertBefore(i,s)},l.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var u="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),p=0;p<u.length;++p)l.prototype[u[p]]=c(u[p]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var a=new d(e);return t(function(){e.captureUncaught&&(a._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,a,!0),e.wrapGlobalEventHandlers&&n.wrapGlobals(r,a,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,a,!0);var t=e.autoInstrument;return!1!==e.enabled&&(void 0===t||!0===t||"object"==typeof t&&t.network)&&r.addEventListener&&(r.addEventListener("load",a.captureLoad.bind(a)),r.addEventListener("DOMContentLoaded",a.captureDomContentLoaded.bind(a))),r[o]=a,a})()}},Rollbar:d}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(r.onerror){for(n=r.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var t=function(){var o=Array.prototype.slice.call(arguments,0);!function(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}(r,e,n,o)};o&&(t._rollbarOldOnError=n),r.onerror=t}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}},wrapGlobals:function(r,e,o){if(r){var t,a,l="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".split(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.15.0/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),s=function(r,e){return new l(r,e)},d=function(r){return new i(s,r)};function c(r){return t((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i<t.length;++i)if("function"==typeof(l=t[i])){l(e);break}}"function"==typeof a&&a(e)}()}})),d.insertBefore(i,s)},l.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var u="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),p=0;p<u.length;++p)l.prototype[u[p]]=c(u[p]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var a=new d(e);return t((function(){e.captureUncaught&&(a._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,a,!0),e.wrapGlobalEventHandlers&&n.wrapGlobals(r,a,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,a,!0);var t=e.autoInstrument;return!1!==e.enabled&&(void 0===t||!0===t||"object"==typeof t&&t.network)&&r.addEventListener&&(r.addEventListener("load",a.captureLoad.bind(a)),r.addEventListener("DOMContentLoaded",a.captureDomContentLoaded.bind(a))),r[o]=a,a}))()}},Rollbar:d}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}function t(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}},wrapGlobals:function(r,e,o){if(r){var n,a,l="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".split(",");for(n=0;n<l.length;++n)r[a=l[n]]&&r[a].prototype&&t(e,r[a].prototype,o)}}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);

@@ -147,7 +147,6 @@ /**

grunt.loadNpmTasks('grunt-express');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks("grunt-vows");
grunt.loadNpmTasks('grunt-vows');

@@ -164,5 +163,5 @@

options: {
reporter: "spec"
reporter: 'spec'
},
src: ["test/server.*.test.js"]
src: ['test/server.*.test.js']
}

@@ -180,3 +179,3 @@ },

{
from: new RegExp('^(.*// Rollbar Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar Snippet)', 'm'),
from: new RegExp('^(.*// Rollbar Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar Snippet)', 'm'), // eslint-disable-line no-control-regex
to: function(match, index, fullText, captures) {

@@ -189,3 +188,3 @@ captures[1] = rollbarJsSnippet;

{
from: new RegExp('^(.*// Rollbar jQuery Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar jQuery Snippet)', 'm'),
from: new RegExp('^(.*// Rollbar jQuery Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar jQuery Snippet)', 'm'), // eslint-disable-line no-control-regex
to: function(match, index, fullText, captures) {

@@ -214,3 +213,3 @@ captures[1] = rollbarjQuerySnippet;

grunt.registerTask('test-server', function(target) {
grunt.registerTask('test-server', function(_target) {
var tasks = ['vows'];

@@ -217,0 +216,0 @@ grunt.task.run.apply(grunt.task, tasks);

@@ -82,3 +82,3 @@ var path = require('path');

options: {
configFile: path.resolve(__dirname, ".eslintrc")
configFile: path.resolve(__dirname, '.eslintrc')
}

@@ -85,0 +85,0 @@ },

{
"name": "rollbar",
"version": "2.14.4",
"version": "2.15.0",
"repository": {

@@ -27,3 +27,3 @@ "type": "git",

"babel-core": "^6.26.3",
"babel-eslint": "^10.0.1",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.4",

@@ -34,33 +34,27 @@ "bluebird": "^3.3.5",

"chalk": "^1.1.1",
"eslint": "^5.16.0",
"eslint-loader": "^2.1.2",
"eslint": "^6.8.0",
"eslint-loader": "^3.0.3",
"express": "^4.16.4",
"glob": "^5.0.14",
"grunt": "^1.0.3",
"grunt-blanket-mocha": "^1.0.0",
"grunt": "^1.0.4",
"grunt-bumpup": "^0.6.3",
"grunt-cli": "^1.3.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "^2.0.0",
"grunt-contrib-connect": "^2.1.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-jshint": "^2.0.0",
"grunt-contrib-jshint": "^2.1.0",
"grunt-contrib-uglify": "^4.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-express": "^1.4.1",
"grunt-karma": "^3.0.1",
"grunt-karma-coveralls": "^2.5.4",
"grunt-mocha": "^1.1.0",
"grunt-mocha-cov": "^0.4.0",
"grunt-karma": "^3.0.2",
"grunt-mocha": "^1.2.0",
"grunt-parallel": "^0.5.1",
"grunt-saucelabs": "^9.0.0",
"grunt-tagrelease": "~0.3.0",
"grunt-text-replace": "^0.4.0",
"grunt-vows": "^0.4.2",
"grunt-webpack": "^3.1.3",
"istanbul-instrumenter-loader": "^2.0.0",
"istanbul-instrumenter-loader": "^3.0.1",
"jade": "~0.27.7",
"jasmine-core": "^2.3.4",
"jquery-mockjax": "^2.0.1",
"karma": "^4.0.1",
"karma-browserstack-launcher": "^0.1.5",
"jquery-mockjax": "^2.5.0",
"karma": "^4.4.1",
"karma-browserstack-launcher": "^1.5.1",
"karma-chai": "^0.1.0",

@@ -72,5 +66,4 @@ "karma-chrome-launcher": "^2.2.0",

"karma-jquery": "^0.1.0",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.1.1",
"karma-phantomjs-launcher": "^1.0.4",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-requirejs": "^0.2.2",

@@ -80,20 +73,17 @@ "karma-safari-launcher": "^0.1.1",

"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^3.0.5",
"karma-webpack": "^4.0.2",
"mocha": "^5.2.0",
"mootools": "^1.5.1",
"natives": "^1.1.6",
"nock": "^9.0.7",
"node-libs-browser": "^0.5.2",
"phantomjs": "^2.1.0",
"request": "^2.88.0",
"requirejs": "^2.1.20",
"script-loader": "0.6.1",
"sinon": "^7.3.0",
"sinon": "^8.1.1",
"stackframe": "^0.2.2",
"strict-loader": "^1.2.0",
"time-grunt": "^1.0.0",
"uglifyjs-webpack-plugin": "^2.1.2",
"vows": "~0.7.0",
"webpack": "^4.30.0",
"webpack-dev-server": "^3.1.10"
"vows": "^0.8.3",
"webpack": "^4.41.5",
"webpack-dev-server": "^3.10.3"
},

@@ -109,6 +99,6 @@ "optionalDependencies": {

"test_ci": "./node_modules/.bin/grunt test",
"lint": "./node_modules/.bin/eslint"
"lint": "./node_modules/.bin/eslint . --ext .js"
},
"cdn": {
"host": "cdnjs.cloudflare.com"
"host": "cdn.rollbar.com"
},

@@ -221,3 +211,4 @@ "defaults": {

"^.*/[0-9A-Fa-f]{64}/codepush_ios/(.*)$",
"^.*/[0-9A-Fa-f]{64}/codepush_android/(.*)$"
"^.*/[0-9A-Fa-f]{64}/codepush_android/(.*)$",
"^.*/[0-9A-Fa-f]{64}/CodePush/(.*)$"
]

@@ -224,0 +215,0 @@ },

# Rollbar.js
[![Build Status](https://api.travis-ci.org/rollbar/rollbar.js.png?branch=v2.14.4)](https://travis-ci.org/rollbar/rollbar.js)
[![Build Status](https://api.travis-ci.org/rollbar/rollbar.js.png?branch=v2.15.0)](https://travis-ci.org/rollbar/rollbar.js)
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/rollbar/rollbar.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rollbar/rollbar.js/context:javascript)

@@ -5,0 +5,0 @@ [![Total Alerts](https://img.shields.io/lgtm/alerts/g/rollbar/rollbar.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rollbar/rollbar.js/alerts)

@@ -505,2 +505,6 @@ var Client = require('../rollbar');

Rollbar.prototype.loadFull = function() {
logger.info('Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.');
};
function _getFirstFunction(args) {

@@ -507,0 +511,0 @@ for (var i = 0, len = args.length; i < len; ++i) {

@@ -11,2 +11,5 @@ var _ = require('../utility');

networkRequestBody: false,
networkErrorOnHttp5xx: false,
networkErrorOnHttp4xx: false,
networkErrorOnHttp0: false,
log: true,

@@ -278,2 +281,3 @@ dom: true,

xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);
self.errorOnHttpStatus(xhr.__rollbar_xhr);
} catch (e) {

@@ -297,2 +301,5 @@ /* ignore possible exception from xhr.status */

}
if (xhr.__rollbar_xhr) {
xhr.__rollbar_xhr.stack = (new Error()).stack;
}
return orig.apply(this, arguments);

@@ -353,2 +360,3 @@ }

self.captureNetwork(metadata, 'fetch', undefined);
metadata.stack = (new Error()).stack;
return orig.apply(this, args).then(function (resp) {

@@ -386,2 +394,3 @@ metadata.end_time_ms = _.now();

}
self.errorOnHttpStatus(metadata);
return resp;

@@ -434,2 +443,14 @@ });

Instrumenter.prototype.errorOnHttpStatus = function(metadata) {
var status = metadata.status_code;
if ((status >= 500 && this.autoInstrument.networkErrorOnHttp5xx) ||
(status >= 400 && this.autoInstrument.networkErrorOnHttp4xx) ||
(status === 0 && this.autoInstrument.networkErrorOnHttp0)) {
var error = new Error('HTTP request failed with Status ' + status);
error.stack = metadata.stack;
this.rollbar.error(error, { skipFrames: 1 });
}
}
Instrumenter.prototype.deinstrumentConsole = function() {

@@ -436,0 +457,0 @@ if (!('console' in this._window && this._window.console.log)) {

@@ -21,3 +21,3 @@ var _ = require('../utility');

try {
item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);
item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err, item.skipFrames);
} catch (e) {

@@ -24,0 +24,0 @@ logger.error('Error while parsing the error object.', e);

@@ -33,19 +33,10 @@ var ErrorStackParser = require('error-stack-parser');

function Stack(exception) {
function Stack(exception, skip) {
function getStack() {
var parserStack = [];
var exc;
if (!exception.stack) {
try {
throw exception;
} catch (e) {
exc = e;
}
} else {
exc = exception;
}
skip = skip || 0;
try {
parserStack = ErrorStackParser.parse(exc);
parserStack = ErrorStackParser.parse(exception);
} catch(e) {

@@ -57,3 +48,3 @@ parserStack = [];

for (var i = 0; i < parserStack.length; i++) {
for (var i = skip; i < parserStack.length; i++) {
stack.push(new Frame(parserStack[i]));

@@ -75,3 +66,3 @@ }

function parse(e) {
function parse(e, skip) {
var err = e;

@@ -82,4 +73,6 @@

while (err) {
traceChain.push(new Stack(err));
traceChain.push(new Stack(err, skip));
err = err.nested;
skip = 0; // Only apply skip value to primary error
}

@@ -91,3 +84,3 @@

} else {
return new Stack(err);
return new Stack(err, skip);
}

@@ -94,0 +87,0 @@ }

@@ -12,3 +12,3 @@ 'use strict';

var tracePattern =
/^\s*at (?:([^(]+(?: \[\w\s+\])?) )?\(?(.+?)(?::(\d+):(\d+)(?:, <js>:(\d+):(\d+))?)?\)?$/;
/^\s*at (?:([^(]+(?: \[\w\s+\])?(?:.*\)*)) )?\(?(.+?)(?::(\d+):(\d+)(?:, <js>:(\d+):(\d+))?)?\)?$/;

@@ -15,0 +15,0 @@ var jadeTracePattern = /^\s*at .+ \(.+ (at[^)]+\))\)$/;

@@ -326,3 +326,3 @@ var util = require('util');

var self = this;
var _timeoutHandler = function(event, context, cb) {
var _timeoutHandler = function(event, context, _cb) {
var message = 'Function timed out';

@@ -329,0 +329,0 @@ var custom = {

@@ -83,3 +83,3 @@ var _ = require('./utility');

function needsTruncation(payload, maxSize) {
return payload.length > maxSize;
return _.maxByteSize(payload) > maxSize;
}

@@ -86,0 +86,0 @@

@@ -336,2 +336,29 @@ var merge = require('./merge');

function maxByteSize(string) {
// The transport will use utf-8, so assume utf-8 encoding.
//
// This minimal implementation will accurately count bytes for all UCS-2 and
// single code point UTF-16. If presented with multi code point UTF-16,
// which should be rare, it will safely overcount, not undercount.
//
// While robust utf-8 encoders exist, this is far smaller and far more performant.
// For quickly counting payload size for truncation, smaller is better.
var count = 0;
var length = string.length;
for (var i = 0; i < length; i++) {
var code = string.charCodeAt(i);
if (code < 128) { // up to 7 bits
count = count + 1;
} else if (code < 2048) { // up to 11 bits
count = count + 2;
} else if (code < 65536) { // up to 16 bits
count = count + 3;
}
}
return count;
}
function jsonParse(s) {

@@ -456,6 +483,5 @@ var value, error;

};
if (custom && custom.level !== undefined) {
item.level = custom.level;
delete custom.level;
}
setCustomItemKeys(item, custom);
if (requestKeys && request) {

@@ -471,2 +497,13 @@ item.request = request;

function setCustomItemKeys(item, custom) {
if (custom && custom.level !== undefined) {
item.level = custom.level;
delete custom.level;
}
if (custom && custom.skipFrames !== undefined) {
item.skipFrames = custom.skipFrames;
delete custom.skipFrames;
}
}
var TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];

@@ -742,2 +779,3 @@ var TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];

stringify: stringify,
maxByteSize: maxByteSize,
traverse: traverse,

@@ -744,0 +782,0 @@ typeName: typeName,

@@ -641,2 +641,29 @@ /* globals expect */

})
it('should skipFrames when set', function(done) {
var server = window.server;
stubResponse(server);
server.requests.length = 0;
var options = {
accessToken: 'POST_CLIENT_ITEM_TOKEN',
captureUnhandledRejections: true
};
var rollbar = window.rollbar = new Rollbar(options);
var error = new Error('error with stack');
rollbar.log(error);
rollbar.log(error, { skipFrames: 1 });
server.respond();
var frames1 = JSON.parse(server.requests[0].requestBody).data.body.trace.frames;
var frames2 = JSON.parse(server.requests[1].requestBody).data.body.trace.frames;
expect(frames1.length).to.eql(frames2.length + 1);
expect(frames1.slice(0,-1)).to.eql(frames2);
done();
})
});

@@ -690,3 +717,3 @@

describe('options.autoInstrument.log', function() {
describe('options.autoInstrument', function() {
beforeEach(function (done) {

@@ -1027,2 +1054,18 @@ window.server = sinon.createFakeServer();

});
it('should handle custom arguments', function(done) {
var client = new (TestClientGen())();
var options = {};
var rollbar = window.rollbar = new Rollbar(options, client);
var args = [new Error('Whoa'), {level: 'info', skipFrames: 1, foo: 'bar'}];
var item = rollbar._createItem(args);
expect(item.err).to.eql(args[0]);
expect(item.level).to.eql('info');
expect(item.skipFrames).to.eql(1);
expect(item.custom.foo).to.eql('bar');
expect(item.custom.level).to.not.be.ok();
expect(item.custom.skipFrames).to.not.be.ok();
done();
});
it('should have a timestamp', function(done) {

@@ -1029,0 +1072,0 @@ var client = new (TestClientGen())();

@@ -28,2 +28,20 @@ /* globals expect */

});
it('should not truncate ascii payload close to max size', function() {
var payload = tracePayload(10, repeat('i', 500));
var result = t.truncate(payload, undefined, 1100); // payload will be 500 + 528
expect(result.value).to.be.ok();
var resultValue = JSON.parse(result.value);
expect(resultValue).to.eql(payload);
});
it('should truncate non-ascii payload when oversize', function() {
var payload = tracePayload(10, repeat('あ', 500)); // あ is 3 utf-8 bytes (U+3042)
var result = t.truncate(payload, undefined, 1100); // payload will be 1500 + 528
expect(result.value).to.be.ok();
var resultValue = JSON.parse(result.value);
expect(resultValue.data.body.trace.frames.length).to.be.below(3);
});
});

@@ -30,0 +48,0 @@

@@ -5,3 +5,3 @@ var extend = require('util')._extend;

var defaults = require('./defaults');
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var TerserPlugin = require('terser-webpack-plugin');

@@ -11,3 +11,3 @@ var outputPath = path.resolve(__dirname, 'dist');

var defaultsPlugin = new webpack.DefinePlugin(defaults);
var uglifyPlugin = new UglifyJsPlugin({
var uglifyPlugin = new TerserPlugin({
sourceMap: true,

@@ -14,0 +14,0 @@ parallel: true

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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