All files / src/utils/runPlugins runPlugins.ts

100% Statements 12/12
100% Branches 2/2
100% Functions 3/3
100% Lines 10/10

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 232x           2x 19x     2x 66x     2x 38x 38x   38x 52x      
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useHandler = useHandler;
exports.useApp = useApp;
exports.runPlugins = runPlugins;
const constants_1 = require("../../constants");
let currentHandler;
let currentApp;
function useHandler() {
    return currentHandler;
}
function useApp() {
    return currentApp;
}
function runPlugins(app, handler, plugins = handler[constants_1.PLUGINS]) {
    currentApp = app;
    currentHandler = handler;
    for (let i = 0; i < plugins.length; i++) {
        if (plugins[i]() !== constants_1.NEXT)
            return;
    }
}