All files / src/utils/createHandler createHandler.ts

100% Statements 8/8
75% Branches 3/4
100% Functions 1/1
100% Lines 8/8

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 132x   2x 2x   2x 13x 13x   13x   13x  
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createHandler = createHandler;
const constants_1 = require("../../constants");
const activatePlugins_1 = require("../activatePlugins");
const extendHandler_1 = require("../extendHandler");
function createHandler(plugins, extendedHandler) {
    const handler = (0, extendHandler_1.extendHandler)(extendedHandler || null);
    const createdPlugins = handler[constants_1.PLUGINS] = extendedHandler ? handler[constants_1.PLUGINS].slice() : [];
    (0, activatePlugins_1.activatePlugins)(plugins, createdPlugins, handler);
    return handler;
}