All files / browser/dist load.js

61.54% Statements 16/26
0% Branches 0/2
11.11% Functions 1/9
61.54% Lines 16/26

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  2x 2x 2x 2x 2x 2x 2x   1x           1x           1x           1x           1x           1x           1x                           1x             2x  
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupReplace = void 0;
var handleEvents_1 = require("./handleEvents");
var utils_1 = require("@mito/utils");
var common_1 = require("@mito/common");
var core_1 = require("@mito/core");
var replace_1 = require("./replace");
function setupReplace() {
    replace_1.addReplaceHandler({
        callback: function (data) {
            handleEvents_1.HandleEvents.handleHttp(data, common_1.BREADCRUMBTYPES.XHR);
        },
        type: common_1.EVENTTYPES.XHR
    });
    replace_1.addReplaceHandler({
        callback: function (data) {
            handleEvents_1.HandleEvents.handleHttp(data, common_1.BREADCRUMBTYPES.FETCH);
        },
        type: common_1.EVENTTYPES.FETCH
    });
    replace_1.addReplaceHandler({
        callback: function (error) {
            handleEvents_1.HandleEvents.handleError(error);
        },
        type: common_1.EVENTTYPES.ERROR
    });
    replace_1.addReplaceHandler({
        callback: function (data) {
            common_1.handleConsole(data);
        },
        type: common_1.EVENTTYPES.CONSOLE
    });
    replace_1.addReplaceHandler({
        callback: function (data) {
            handleEvents_1.HandleEvents.handleHistory(data);
        },
        type: common_1.EVENTTYPES.HISTORY
    });
    replace_1.addReplaceHandler({
        callback: function (data) {
            handleEvents_1.HandleEvents.handleUnhandleRejection(data);
        },
        type: common_1.EVENTTYPES.UNHANDLEDREJECTION
    });
    replace_1.addReplaceHandler({
        callback: function (data) {
            var htmlString = utils_1.htmlElementAsString(data.data.activeElement);
            if (htmlString) {
                core_1.breadcrumb.push({
                    type: common_1.BREADCRUMBTYPES.CLICK,
                    category: core_1.breadcrumb.getCategory(common_1.BREADCRUMBTYPES.CLICK),
                    data: htmlString,
                    level: utils_1.Severity.Info
                });
            }
        },
        type: common_1.EVENTTYPES.DOM
    });
    replace_1.addReplaceHandler({
        callback: function (e) {
            handleEvents_1.HandleEvents.handleHashchange(e);
        },
        type: common_1.EVENTTYPES.HASHCHANGE
    });
}
exports.setupReplace = setupReplace;
//# sourceMappingURL=load.js.map