All files plugins.ts

100% Statements 13/13
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 23 24 252x           2x 19x     2x 34x     40x 20x 20x   20x 34x          
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runPlugins = exports.useApp = exports.useHandler = void 0;
var constants_1 = require("./constants");
var currentHandler;
var currentApp;
function useHandler() {
    return currentHandler;
}
exports.useHandler = useHandler;
function useApp() {
    return currentApp;
}
exports.useApp = useApp;
function runPlugins(app, handler, plugins) {
    if (plugins === void 0) { plugins = handler[constants_1.PLUGINS]; }
    currentApp = app;
    currentHandler = handler;
    for (var i = 0; i < plugins.length; i++) {
        if (plugins[i]() !== constants_1.NEXT)
            return;
    }
}
exports.runPlugins = runPlugins;