Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | 9x 9x 9x 9x 9x 9x 9x 9x 9x 26x 26x 2x 2x 2x 2x 2x 1x 1x 1x 24x 9x 25x 25x 4x 25x 25x 9x 4x 9x 5x 9x 9x 9x 16x 4x 2x 3x 7x 9x 3x 3x 3x 3x 9x 9x 9x 9x | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.breadcrumb = exports.Breadcrumb = void 0;
var common_1 = require("@mito/common");
var utils_1 = require("@mito/utils");
var Breadcrumb = (function () {
function Breadcrumb() {
this.maxBreadcrumbs = 10;
this.beforePushBreadcrumb = null;
this.stack = [];
}
Breadcrumb.prototype.push = function (data) {
var _this = this;
if (typeof this.beforePushBreadcrumb === 'function') {
var result_1 = null;
var beforePushBreadcrumb_1 = this.beforePushBreadcrumb;
utils_1.slientConsoleScope(function () {
result_1 = beforePushBreadcrumb_1(_this, data);
});
if (!result_1)
return;
this.immediatePush(result_1);
return;
}
this.immediatePush(data);
};
Breadcrumb.prototype.immediatePush = function (data) {
data.time = utils_1.getTimestamp();
if (this.stack.length >= this.maxBreadcrumbs) {
this.shift();
}
this.stack.push(data);
utils_1.logger.log(this.stack);
};
Breadcrumb.prototype.shift = function () {
return this.stack.shift() !== undefined;
};
Breadcrumb.prototype.clear = function () {
this.stack = [];
};
Breadcrumb.prototype.getStack = function () {
return this.stack;
};
Breadcrumb.prototype.getCategory = function (type) {
switch (type) {
case common_1.BREADCRUMBTYPES.XHR:
case common_1.BREADCRUMBTYPES.FETCH:
return common_1.BREADCRUMBCATEGORYS.HTTP;
case common_1.BREADCRUMBTYPES.CLICK:
case common_1.BREADCRUMBTYPES.ROUTE:
case common_1.BREADCRUMBTYPES.TAP:
case common_1.BREADCRUMBTYPES.TOUCHMOVE:
return common_1.BREADCRUMBCATEGORYS.USER;
case common_1.BREADCRUMBTYPES.CUSTOMER:
case common_1.BREADCRUMBTYPES.CONSOLE:
return common_1.BREADCRUMBCATEGORYS.DEBUG;
case common_1.BREADCRUMBTYPES.APP_ON_LAUNCH:
case common_1.BREADCRUMBTYPES.APP_ON_SHOW:
case common_1.BREADCRUMBTYPES.APP_ON_HIDE:
case common_1.BREADCRUMBTYPES.PAGE_ON_SHOW:
case common_1.BREADCRUMBTYPES.PAGE_ON_HIDE:
case common_1.BREADCRUMBTYPES.PAGE_ON_SHARE_APP_MESSAGE:
case common_1.BREADCRUMBTYPES.PAGE_ON_SHARE_TIMELINE:
case common_1.BREADCRUMBTYPES.PAGE_ON_TAB_ITEM_TAP:
return common_1.BREADCRUMBCATEGORYS.LIFECYCLE;
case common_1.BREADCRUMBTYPES.UNHANDLEDREJECTION:
case common_1.BREADCRUMBTYPES.CODE_ERROR:
case common_1.BREADCRUMBTYPES.RESOURCE:
case common_1.BREADCRUMBTYPES.VUE:
case common_1.BREADCRUMBTYPES.REACT:
default:
return common_1.BREADCRUMBCATEGORYS.EXCEPTION;
}
};
Breadcrumb.prototype.bindOptions = function (options) {
Iif (options === void 0) { options = {}; }
var maxBreadcrumbs = options.maxBreadcrumbs, beforePushBreadcrumb = options.beforePushBreadcrumb;
utils_1.validateOption(maxBreadcrumbs, 'maxBreadcrumbs', 'number') && (this.maxBreadcrumbs = maxBreadcrumbs);
utils_1.validateOption(beforePushBreadcrumb, 'beforePushBreadcrumb', 'function') && (this.beforePushBreadcrumb = beforePushBreadcrumb);
};
return Breadcrumb;
}());
exports.Breadcrumb = Breadcrumb;
var breadcrumb = utils_1._support.breadcrumb || (utils_1._support.breadcrumb = new Breadcrumb());
exports.breadcrumb = breadcrumb;
//# sourceMappingURL=breadcrumb.js.map |