"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.executeFunctionStack = void 0;
function executeFunctionStack(input, scope, funcs, baseFunc, config) {
    const funcList = [];
    if (Array.isArray(funcs)) {
        funcList.push(...funcs);
    }
    else {
        funcList.push(funcs);
    }
    let next = baseFunc;
    while (funcList.length > 0) {
        const func = funcList.pop();
        if (func) {
            const warppedFunc = ((nextFunc) => (i, s, cfg) => func(i, s, cfg, nextFunc))(next);
            next = warppedFunc;
        }
    }
    return next(input, scope, config);
}
exports.executeFunctionStack = executeFunctionStack;
//# sourceMappingURL=aopHelper.js.map