Socket
Socket
Sign inDemoInstall

@sentry/integrations

Package Overview
Dependencies
Maintainers
12
Versions
385
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/integrations - npm Package Compare versions

Comparing version 5.11.1 to 5.12.0

422

build/captureconsole.js

@@ -276,94 +276,2 @@ (function (__window) {

*/
function isError(wat) {
switch (Object.prototype.toString.call(wat)) {
case '[object Error]':
return true;
case '[object Exception]':
return true;
case '[object DOMException]':
return true;
default:
return isInstanceOf(wat, Error);
}
}
/**
* Checks whether given value's type is a string
* {@link isString}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isString(wat) {
return Object.prototype.toString.call(wat) === '[object String]';
}
/**
* Checks whether given value's is a primitive (undefined, null, number, boolean, string)
* {@link isPrimitive}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isPrimitive(wat) {
return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');
}
/**
* Checks whether given value's type is an object literal
* {@link isPlainObject}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isPlainObject(wat) {
return Object.prototype.toString.call(wat) === '[object Object]';
}
/**
* Checks whether given value's type is an Event instance
* {@link isEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isEvent(wat) {
// tslint:disable-next-line:strict-type-predicates
return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
}
/**
* Checks whether given value's type is an Element instance
* {@link isElement}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isElement(wat) {
// tslint:disable-next-line:strict-type-predicates
return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
}
/**
* Checks whether given value's type is a SyntheticEvent
* {@link isSyntheticEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
function isSyntheticEvent(wat) {
// tslint:disable-next-line:no-unsafe-any
return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
}
/**
* Checks whether given value's type is an instance of provided constructor.
* {@link isInstanceOf}.
*
* @param wat A value to be checked.
* @param base A constructor to be used in a check.
* @returns A boolean representing the result.
*/
function isInstanceOf(wat, base) {
try {
// tslint:disable-next-line:no-unsafe-any
return wat instanceof base;
}
catch (_e) {
return false;
}
}

@@ -442,96 +350,2 @@ /**

}
/**
* Given a child DOM element, returns a query-selector statement describing that
* and its ancestors
* e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
* @returns generated DOM path
*/
function htmlTreeAsString(elem) {
// try/catch both:
// - accessing event.target (see getsentry/raven-js#838, #768)
// - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
// - can throw an exception in some circumstances.
try {
var currentElem = elem;
var MAX_TRAVERSE_HEIGHT = 5;
var MAX_OUTPUT_LEN = 80;
var out = [];
var height = 0;
var len = 0;
var separator = ' > ';
var sepLength = separator.length;
var nextStr = void 0;
while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
nextStr = _htmlElementAsString(currentElem);
// bail out if
// - nextStr is the 'html' element
// - the length of the string that would be created exceeds MAX_OUTPUT_LEN
// (ignore this limit if we are on the first iteration)
if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {
break;
}
out.push(nextStr);
len += nextStr.length;
currentElem = currentElem.parentNode;
}
return out.reverse().join(separator);
}
catch (_oO) {
return '<unknown>';
}
}
/**
* Returns a simple, query-selector representation of a DOM element
* e.g. [HTMLElement] => input#foo.btn[name=baz]
* @returns generated DOM path
*/
function _htmlElementAsString(el) {
var elem = el;
var out = [];
var className;
var classes;
var key;
var attr;
var i;
if (!elem || !elem.tagName) {
return '';
}
out.push(elem.tagName.toLowerCase());
if (elem.id) {
out.push("#" + elem.id);
}
className = elem.className;
if (className && isString(className)) {
classes = className.split(/\s+/);
for (i = 0; i < classes.length; i++) {
out.push("." + classes[i]);
}
}
var attrWhitelist = ['type', 'name', 'title', 'alt'];
for (i = 0; i < attrWhitelist.length; i++) {
key = attrWhitelist[i];
attr = elem.getAttribute(key);
if (attr) {
out.push("[" + key + "=\"" + attr + "\"]");
}
}
return out.join('');
}
var defaultFunctionName = '<anonymous>';
/**
* Safely extract function name from itself
*/
function getFunctionName(fn) {
try {
if (!fn || typeof fn !== 'function') {
return defaultFunctionName;
}
return fn.name || defaultFunctionName;
}
catch (e) {
// Just accessing custom props in some Selenium environments
// can cause a "Permission denied" exception (see raven-js#495).
return defaultFunctionName;
}
}

@@ -602,52 +416,2 @@ // TODO: Implement different loggers for different environments

// tslint:disable:no-unsafe-any
/**
* Memo class used for decycle json objects. Uses WeakSet if available otherwise array.
*/
var Memo = /** @class */ (function () {
function Memo() {
// tslint:disable-next-line
this._hasWeakSet = typeof WeakSet === 'function';
this._inner = this._hasWeakSet ? new WeakSet() : [];
}
/**
* Sets obj to remember.
* @param obj Object to remember
*/
Memo.prototype.memoize = function (obj) {
if (this._hasWeakSet) {
if (this._inner.has(obj)) {
return true;
}
this._inner.add(obj);
return false;
}
// tslint:disable-next-line:prefer-for-of
for (var i = 0; i < this._inner.length; i++) {
var value = this._inner[i];
if (value === obj) {
return true;
}
}
this._inner.push(obj);
return false;
};
/**
* Removes object from internal storage.
* @param obj Object to forget
*/
Memo.prototype.unmemoize = function (obj) {
if (this._hasWeakSet) {
this._inner.delete(obj);
}
else {
for (var i = 0; i < this._inner.length; i++) {
if (this._inner[i] === obj) {
this._inner.splice(i, 1);
break;
}
}
}
};
return Memo;
}());

@@ -688,184 +452,2 @@ /**

}
/**
* Transforms any object into an object literal with all it's attributes
* attached to it.
*
* @param value Initial source that we have to transform in order to be usable by the serializer
*/
function getWalkSource(value) {
if (isError(value)) {
var error = value;
var err = {
message: error.message,
name: error.name,
stack: error.stack,
};
for (var i in error) {
if (Object.prototype.hasOwnProperty.call(error, i)) {
err[i] = error[i];
}
}
return err;
}
if (isEvent(value)) {
var event_1 = value;
var source = {};
source.type = event_1.type;
// Accessing event.target can throw (see getsentry/raven-js#838, #768)
try {
source.target = isElement(event_1.target)
? htmlTreeAsString(event_1.target)
: Object.prototype.toString.call(event_1.target);
}
catch (_oO) {
source.target = '<unknown>';
}
try {
source.currentTarget = isElement(event_1.currentTarget)
? htmlTreeAsString(event_1.currentTarget)
: Object.prototype.toString.call(event_1.currentTarget);
}
catch (_oO) {
source.currentTarget = '<unknown>';
}
// tslint:disable-next-line:strict-type-predicates
if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {
source.detail = event_1.detail;
}
for (var i in event_1) {
if (Object.prototype.hasOwnProperty.call(event_1, i)) {
source[i] = event_1;
}
}
return source;
}
return value;
}
/** Transforms any input value into a string form, either primitive value or a type of the input */
function serializeValue(value) {
var type = Object.prototype.toString.call(value);
// Node.js REPL notation
if (typeof value === 'string') {
return value;
}
if (type === '[object Object]') {
return '[Object]';
}
if (type === '[object Array]') {
return '[Array]';
}
var normalized = normalizeValue(value);
return isPrimitive(normalized) ? normalized : type;
}
/**
* normalizeValue()
*
* Takes unserializable input and make it serializable friendly
*
* - translates undefined/NaN values to "[undefined]"/"[NaN]" respectively,
* - serializes Error objects
* - filter global objects
*/
// tslint:disable-next-line:cyclomatic-complexity
function normalizeValue(value, key) {
if (key === 'domain' && value && typeof value === 'object' && value._events) {
return '[Domain]';
}
if (key === 'domainEmitter') {
return '[DomainEmitter]';
}
if (typeof global !== 'undefined' && value === global) {
return '[Global]';
}
if (typeof window !== 'undefined' && value === window) {
return '[Window]';
}
if (typeof document !== 'undefined' && value === document) {
return '[Document]';
}
// React's SyntheticEvent thingy
if (isSyntheticEvent(value)) {
return '[SyntheticEvent]';
}
// tslint:disable-next-line:no-tautology-expression
if (typeof value === 'number' && value !== value) {
return '[NaN]';
}
if (value === void 0) {
return '[undefined]';
}
if (typeof value === 'function') {
return "[Function: " + getFunctionName(value) + "]";
}
return value;
}
/**
* Walks an object to perform a normalization on it
*
* @param key of object that's walked in current iteration
* @param value object to be walked
* @param depth Optional number indicating how deep should walking be performed
* @param memo Optional Memo class handling decycling
*/
function walk(key, value, depth, memo) {
if (depth === void 0) { depth = +Infinity; }
if (memo === void 0) { memo = new Memo(); }
// If we reach the maximum depth, serialize whatever has left
if (depth === 0) {
return serializeValue(value);
}
// If value implements `toJSON` method, call it and return early
// tslint:disable:no-unsafe-any
if (value !== null && value !== undefined && typeof value.toJSON === 'function') {
return value.toJSON();
}
// tslint:enable:no-unsafe-any
// If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further
var normalized = normalizeValue(value, key);
if (isPrimitive(normalized)) {
return normalized;
}
// Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself
var source = getWalkSource(value);
// Create an accumulator that will act as a parent for all future itterations of that branch
var acc = Array.isArray(value) ? [] : {};
// If we already walked that branch, bail out, as it's circular reference
if (memo.memoize(value)) {
return '[Circular ~]';
}
// Walk all keys of the source
for (var innerKey in source) {
// Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.
if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {
continue;
}
// Recursively walk through all the child nodes
acc[innerKey] = walk(innerKey, source[innerKey], depth - 1, memo);
}
// Once walked through all the branches, remove the parent from memo storage
memo.unmemoize(value);
// Return accumulated values
return acc;
}
/**
* normalize()
*
* - Creates a copy to prevent original input mutation
* - Skip non-enumerablers
* - Calls `toJSON` if implemented
* - Removes circular references
* - Translates non-serializeable values (undefined/NaN/Functions) to serializable format
* - Translates known global objects/Classes to a string representations
* - Takes care of Error objects serialization
* - Optionally limit depth of final output
*/
function normalize(input, depth) {
try {
// tslint:disable-next-line:no-unsafe-any
return JSON.parse(JSON.stringify(input, function (key, value) { return walk(key, value, depth); }));
}
catch (_oO) {
return '**non-serializable**';
}
}

@@ -928,3 +510,3 @@ // Slightly modified (no IE8 support, ES6) and transcribed to TypeScript

scope.setLevel(Severity.fromString(level));
scope.setExtra('arguments', normalize(args, 3));
scope.setExtra('arguments', args);
scope.addEventProcessor(function (event) {

@@ -938,3 +520,3 @@ event.logger = 'console';

message = "Assertion failed: " + (safeJoin(args.slice(1), ' ') || 'console.assert');
scope.setExtra('arguments', normalize(args.slice(1), 3));
scope.setExtra('arguments', args.slice(1));
hub.captureMessage(message);

@@ -941,0 +523,0 @@ }

2

build/captureconsole.min.js

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

!function(e){var t,n,r,o,i={};Object.defineProperty(i,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Debug=2]="Debug",e[e.Verbose=3]="Verbose"}(t||(t={})),function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(n||(n={})),function(e){e.fromString=function(t){switch(t){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;case"log":default:return e.Log}}}(n||(n={})),function(e){e.Ok="ok",e.DealineExceeded="deadline_exceeded",e.Unauthenticated="unauthenticated",e.PermissionDenied="permission_denied",e.NotFound="not_found",e.ResourceExhausted="resource_exhausted",e.InvalidArgument="invalid_argument",e.Unimplemented="unimplemented",e.Unavailable="unavailable",e.InternalError="internal_error",e.UnknownError="unknown_error",e.Cancelled="cancelled",e.AlreadyExists="already_exists",e.FailedPrecondition="failed_precondition",e.Aborted="aborted",e.OutOfRange="out_of_range",e.DataLoss="data_loss"}(r||(r={})),function(e){e.fromHttpCode=function(t){if(t<400)return e.Ok;if(t>=400&&t<500)switch(t){case 401:return e.Unauthenticated;case 403:return e.PermissionDenied;case 404:return e.NotFound;case 409:return e.AlreadyExists;case 413:return e.FailedPrecondition;case 429:return e.ResourceExhausted;default:return e.InvalidArgument}if(t>=500&&t<600)switch(t){case 501:return e.Unimplemented;case 503:return e.Unavailable;case 504:return e.DealineExceeded;default:return e.InternalError}return e.UnknownError}}(r||(r={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.Invalid="invalid",e.Failed="failed"}(o||(o={})),function(e){e.fromHttpCode=function(t){return t>=200&&t<300?e.Success:429===t?e.RateLimit:t>=400&&t<500?e.Invalid:t>=500?e.Failed:e.Unknown}}(o||(o={}));var a=function(e,t){return(a=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 c=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n]);return e});!function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,c(r,n.prototype),r}(function(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e)}(Error);function u(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function s(e){return"undefined"!=typeof Element&&f(e,Element)}function l(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function f(e,t){try{return e instanceof t}catch(e){return!1}}function p(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var o=e[r];try{n.push(String(o))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}var d={};function g(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:d}function y(e){var t=g();if(!("console"in t))return e();var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach(function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)});var o=e();return Object.keys(r).forEach(function(e){n[e]=r[e]}),o}function _(e){try{for(var t=e,n=[],r=0,o=0,i=" > ".length,a=void 0;t&&r++<5&&!("html"===(a=h(t))||r>1&&o+n.length*i+a.length>=80);)n.push(a),o+=a.length,t=t.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}function h(e){var t,n,r,o,i,a,c=e,u=[];if(!c||!c.tagName)return"";if(u.push(c.tagName.toLowerCase()),c.id&&u.push("#"+c.id),(t=c.className)&&(a=t,"[object String]"===Object.prototype.toString.call(a)))for(n=t.split(/\s+/),i=0;i<n.length;i++)u.push("."+n[i]);var s=["type","name","title","alt"];for(i=0;i<s.length;i++)r=s[i],(o=c.getAttribute(r))&&u.push("["+r+'="'+o+'"]');return u.join("")}var v="<anonymous>";var b=g(),m="Sentry Logger ",E=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&y(function(){b.console.log(m+"[Log]: "+e.join(" "))})},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&y(function(){b.console.warn(m+"[Warn]: "+e.join(" "))})},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&y(function(){b.console.error(m+"[Error]: "+e.join(" "))})},e}();b.__SENTRY__=b.__SENTRY__||{};b.__SENTRY__.logger||(b.__SENTRY__.logger=new E);var w,O=function(){function e(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return e.prototype.memoize=function(e){if(this._hasWeakSet)return!!this._inner.has(e)||(this._inner.add(e),!1);for(var t=0;t<this._inner.length;t++){if(this._inner[t]===e)return!0}return this._inner.push(e),!1},e.prototype.unmemoize=function(e){if(this._hasWeakSet)this._inner.delete(e);else for(var t=0;t<this._inner.length;t++)if(this._inner[t]===e){this._inner.splice(t,1);break}},e}();function S(e){if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return f(e,Error)}}(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if(a=e,"undefined"!=typeof Event&&f(a,Event)){var o=e,i={};i.type=o.type;try{i.target=s(o.target)?_(o.target):Object.prototype.toString.call(o.target)}catch(e){i.target="<unknown>"}try{i.currentTarget=s(o.currentTarget)?_(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(e){i.currentTarget="<unknown>"}for(var r in"undefined"!=typeof CustomEvent&&f(e,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,r)&&(i[r]=o);return i}var a;return e}function j(e,t){return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&e===global?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":l(e)?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+function(e){try{return e&&"function"==typeof e&&e.name||v}catch(e){return v}}(e)+"]":e}function k(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new O),0===n)return function(e){var t=Object.prototype.toString.call(e);if("string"==typeof e)return e;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=j(e);return u(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var o=j(t,e);if(u(o))return o;var i=S(t),a=Array.isArray(t)?[]:{};if(r.memoize(t))return"[Circular ~]";for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(a[c]=k(c,i[c],n-1,r));return r.unmemoize(t),a}function N(e,t){try{return JSON.parse(JSON.stringify(e,function(e,n){return k(e,n,t)}))}catch(e){return"**non-serializable**"}}!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(w||(w={}));g();var D=g(),P=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._levels=["log","info","warn","error","debug","assert"],t.levels&&(this._levels=t.levels)}return e.prototype.setupOnce=function(t,r){"console"in D&&this._levels.forEach(function(t){t in D.console&&function(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry_original__:{enumerable:!1,value:r}})}catch(e){}e[t]=o}}(D.console,t,function(o){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var c=r();c.getIntegration(e)&&c.withScope(function(e){e.setLevel(n.fromString(t)),e.setExtra("arguments",N(i,3)),e.addEventProcessor(function(e){return e.logger="console",e});var r=p(i," ");"assert"===t?!1===i[0]&&(r="Assertion failed: "+(p(i.slice(1)," ")||"console.assert"),e.setExtra("arguments",N(i.slice(1),3)),c.captureMessage(r)):c.captureMessage(r)}),o&&Function.prototype.apply.call(o,D.console,i)}})})},e.id="CaptureConsole",e}();for(var A in i.CaptureConsole=P,e.Sentry=e.Sentry||{},e.Sentry.Integrations=e.Sentry.Integrations||{},i)Object.prototype.hasOwnProperty.call(i,A)&&(e.Sentry.Integrations[A]=i[A])}(window);
!function(e){var n,r,t,o,i={};Object.defineProperty(i,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Debug=2]="Debug",e[e.Verbose=3]="Verbose"}(n||(n={})),function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(r||(r={})),function(e){e.fromString=function(n){switch(n){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;case"log":default:return e.Log}}}(r||(r={})),function(e){e.Ok="ok",e.DealineExceeded="deadline_exceeded",e.Unauthenticated="unauthenticated",e.PermissionDenied="permission_denied",e.NotFound="not_found",e.ResourceExhausted="resource_exhausted",e.InvalidArgument="invalid_argument",e.Unimplemented="unimplemented",e.Unavailable="unavailable",e.InternalError="internal_error",e.UnknownError="unknown_error",e.Cancelled="cancelled",e.AlreadyExists="already_exists",e.FailedPrecondition="failed_precondition",e.Aborted="aborted",e.OutOfRange="out_of_range",e.DataLoss="data_loss"}(t||(t={})),function(e){e.fromHttpCode=function(n){if(n<400)return e.Ok;if(n>=400&&n<500)switch(n){case 401:return e.Unauthenticated;case 403:return e.PermissionDenied;case 404:return e.NotFound;case 409:return e.AlreadyExists;case 413:return e.FailedPrecondition;case 429:return e.ResourceExhausted;default:return e.InvalidArgument}if(n>=500&&n<600)switch(n){case 501:return e.Unimplemented;case 503:return e.Unavailable;case 504:return e.DealineExceeded;default:return e.InternalError}return e.UnknownError}}(t||(t={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.Invalid="invalid",e.Failed="failed"}(o||(o={})),function(e){e.fromHttpCode=function(n){return n>=200&&n<300?e.Success:429===n?e.RateLimit:n>=400&&n<500?e.Invalid:n>=500?e.Failed:e.Unknown}}(o||(o={}));var a=function(e,n){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])})(e,n)};var c=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,n){return e.__proto__=n,e}:function(e,n){for(var r in n)e.hasOwnProperty(r)||(e[r]=n[r]);return e});!function(e){function n(n){var r=this.constructor,t=e.call(this,n)||this;return t.message=n,t.name=r.prototype.constructor.name,c(t,r.prototype),t}(function(e,n){function r(){this.constructor=e}a(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)})(n,e)}(Error);function s(e,n){if(!Array.isArray(e))return"";for(var r=[],t=0;t<e.length;t++){var o=e[t];try{r.push(String(o))}catch(e){r.push("[value cannot be serialized]")}}return r.join(n)}var u={};function l(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:u}function f(e){var n=l();if(!("console"in n))return e();var r=n.console,t={};["debug","info","warn","error","log","assert"].forEach(function(e){e in n.console&&r[e].__sentry_original__&&(t[e]=r[e],r[e]=r[e].__sentry_original__)});var o=e();return Object.keys(t).forEach(function(e){r[e]=t[e]}),o}var d=l(),p="Sentry Logger ",_=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._enabled&&f(function(){d.console.log(p+"[Log]: "+e.join(" "))})},e.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._enabled&&f(function(){d.console.warn(p+"[Warn]: "+e.join(" "))})},e.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._enabled&&f(function(){d.console.error(p+"[Error]: "+e.join(" "))})},e}();d.__SENTRY__=d.__SENTRY__||{};var g;d.__SENTRY__.logger||(d.__SENTRY__.logger=new _);!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(g||(g={}));l();var y=l(),v=function(){function e(n){void 0===n&&(n={}),this.name=e.id,this._levels=["log","info","warn","error","debug","assert"],n.levels&&(this._levels=n.levels)}return e.prototype.setupOnce=function(n,t){"console"in y&&this._levels.forEach(function(n){n in y.console&&function(e,n,r){if(n in e){var t=e[n],o=r(t);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry_original__:{enumerable:!1,value:t}})}catch(e){}e[n]=o}}(y.console,n,function(o){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var c=t();c.getIntegration(e)&&c.withScope(function(e){e.setLevel(r.fromString(n)),e.setExtra("arguments",i),e.addEventProcessor(function(e){return e.logger="console",e});var t=s(i," ");"assert"===n?!1===i[0]&&(t="Assertion failed: "+(s(i.slice(1)," ")||"console.assert"),e.setExtra("arguments",i.slice(1)),c.captureMessage(t)):c.captureMessage(t)}),o&&Function.prototype.apply.call(o,y.console,i)}})})},e.id="CaptureConsole",e}();for(var h in i.CaptureConsole=v,e.Sentry=e.Sentry||{},e.Sentry.Integrations=e.Sentry.Integrations||{},i)Object.prototype.hasOwnProperty.call(i,h)&&(e.Sentry.Integrations[h]=i[h])}(window);
//# sourceMappingURL=captureconsole.min.js.map

@@ -44,3 +44,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

scope.setLevel(types_1.Severity.fromString(level));
scope.setExtra('arguments', utils_1.normalize(args, 3));
scope.setExtra('arguments', args);
scope.addEventProcessor(function (event) {

@@ -54,3 +54,3 @@ event.logger = 'console';

message = "Assertion failed: " + (utils_1.safeJoin(args.slice(1), ' ') || 'console.assert');
scope.setExtra('arguments', utils_1.normalize(args.slice(1), 3));
scope.setExtra('arguments', args.slice(1));
hub.captureMessage(message);

@@ -57,0 +57,0 @@ }

import { Severity } from '@sentry/types';
import { fill, getGlobalObject, normalize, safeJoin } from '@sentry/utils';
import { fill, getGlobalObject, safeJoin } from '@sentry/utils';
var global = getGlobalObject();

@@ -43,3 +43,3 @@ /** Send Console API calls as Sentry Events */

scope.setLevel(Severity.fromString(level));
scope.setExtra('arguments', normalize(args, 3));
scope.setExtra('arguments', args);
scope.addEventProcessor(function (event) {

@@ -53,3 +53,3 @@ event.logger = 'console';

message = "Assertion failed: " + (safeJoin(args.slice(1), ' ') || 'console.assert');
scope.setExtra('arguments', normalize(args.slice(1), 3));
scope.setExtra('arguments', args.slice(1));
hub.captureMessage(message);

@@ -56,0 +56,0 @@ }

{
"name": "@sentry/integrations",
"version": "5.11.1",
"version": "5.12.0",
"description": "Pluggable integrations that can be used to enchance JS SDKs",

@@ -19,4 +19,4 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/types": "5.11.0",
"@sentry/utils": "5.11.1",
"@sentry/types": "5.12.0",
"@sentry/utils": "5.12.0",
"tslib": "^1.9.3"

@@ -23,0 +23,0 @@ },

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 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