@sentry/hub
Advanced tools
Comparing version 5.0.7 to 5.0.8
@@ -163,3 +163,3 @@ "use strict"; | ||
} | ||
var _a = top.client.getOptions(), beforeBreadcrumb = _a.beforeBreadcrumb, _b = _a.maxBreadcrumbs, maxBreadcrumbs = _b === void 0 ? DEFAULT_BREADCRUMBS : _b; | ||
var _a = (top.client.getOptions && top.client.getOptions()) || {}, _b = _a.beforeBreadcrumb, beforeBreadcrumb = _b === void 0 ? null : _b, _c = _a.maxBreadcrumbs, maxBreadcrumbs = _c === void 0 ? DEFAULT_BREADCRUMBS : _c; | ||
if (maxBreadcrumbs <= 0) { | ||
@@ -166,0 +166,0 @@ return; |
@@ -177,6 +177,8 @@ "use strict"; | ||
Scope.prototype.addBreadcrumb = function (breadcrumb, maxBreadcrumbs) { | ||
var timestamp = new Date().getTime() / 1000; | ||
var mergedBreadcrumb = tslib_1.__assign({ timestamp: timestamp }, breadcrumb); | ||
this._breadcrumbs = | ||
maxBreadcrumbs !== undefined && maxBreadcrumbs >= 0 | ||
? tslib_1.__spread(this._breadcrumbs, [utils_1.normalize(breadcrumb)]).slice(-maxBreadcrumbs) | ||
: tslib_1.__spread(this._breadcrumbs, [utils_1.normalize(breadcrumb)]); | ||
? tslib_1.__spread(this._breadcrumbs, [utils_1.normalize(mergedBreadcrumb)]).slice(-maxBreadcrumbs) | ||
: tslib_1.__spread(this._breadcrumbs, [utils_1.normalize(mergedBreadcrumb)]); | ||
this._notifyScopeListeners(); | ||
@@ -236,6 +238,4 @@ return this; | ||
this._applyFingerprint(event); | ||
var hasNoBreadcrumbs = !event.breadcrumbs || event.breadcrumbs.length === 0; | ||
if (hasNoBreadcrumbs && this._breadcrumbs.length > 0) { | ||
event.breadcrumbs = this._breadcrumbs; | ||
} | ||
event.breadcrumbs = tslib_1.__spread((event.breadcrumbs || []), this._breadcrumbs); | ||
event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined; | ||
return this._notifyEventProcessors(tslib_1.__spread(getGlobalEventProcessors(), this._eventProcessors), event, hint); | ||
@@ -242,0 +242,0 @@ }; |
@@ -161,3 +161,3 @@ import * as tslib_1 from "tslib"; | ||
} | ||
var _a = top.client.getOptions(), beforeBreadcrumb = _a.beforeBreadcrumb, _b = _a.maxBreadcrumbs, maxBreadcrumbs = _b === void 0 ? DEFAULT_BREADCRUMBS : _b; | ||
var _a = (top.client.getOptions && top.client.getOptions()) || {}, _b = _a.beforeBreadcrumb, beforeBreadcrumb = _b === void 0 ? null : _b, _c = _a.maxBreadcrumbs, maxBreadcrumbs = _c === void 0 ? DEFAULT_BREADCRUMBS : _c; | ||
if (maxBreadcrumbs <= 0) { | ||
@@ -164,0 +164,0 @@ return; |
@@ -175,6 +175,8 @@ import * as tslib_1 from "tslib"; | ||
Scope.prototype.addBreadcrumb = function (breadcrumb, maxBreadcrumbs) { | ||
var timestamp = new Date().getTime() / 1000; | ||
var mergedBreadcrumb = tslib_1.__assign({ timestamp: timestamp }, breadcrumb); | ||
this._breadcrumbs = | ||
maxBreadcrumbs !== undefined && maxBreadcrumbs >= 0 | ||
? tslib_1.__spread(this._breadcrumbs, [normalize(breadcrumb)]).slice(-maxBreadcrumbs) | ||
: tslib_1.__spread(this._breadcrumbs, [normalize(breadcrumb)]); | ||
? tslib_1.__spread(this._breadcrumbs, [normalize(mergedBreadcrumb)]).slice(-maxBreadcrumbs) | ||
: tslib_1.__spread(this._breadcrumbs, [normalize(mergedBreadcrumb)]); | ||
this._notifyScopeListeners(); | ||
@@ -234,6 +236,4 @@ return this; | ||
this._applyFingerprint(event); | ||
var hasNoBreadcrumbs = !event.breadcrumbs || event.breadcrumbs.length === 0; | ||
if (hasNoBreadcrumbs && this._breadcrumbs.length > 0) { | ||
event.breadcrumbs = this._breadcrumbs; | ||
} | ||
event.breadcrumbs = tslib_1.__spread((event.breadcrumbs || []), this._breadcrumbs); | ||
event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined; | ||
return this._notifyEventProcessors(tslib_1.__spread(getGlobalEventProcessors(), this._eventProcessors), event, hint); | ||
@@ -240,0 +240,0 @@ }; |
{ | ||
"name": "@sentry/hub", | ||
"version": "5.0.7", | ||
"version": "5.0.8", | ||
"description": "Sentry hub which handles global state managment.", | ||
@@ -20,3 +20,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"@sentry/types": "5.0.6", | ||
"@sentry/utils": "5.0.7", | ||
"@sentry/utils": "5.0.8", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124926
+ Added@sentry/utils@5.0.8(transitive)
- Removed@sentry/utils@5.0.7(transitive)
Updated@sentry/utils@5.0.8