"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.InjectHelper = void 0;
const handlebars_1 = __importDefault(require("handlebars"));
/**
 * Defines and registers custom handlebar helper - inject
 */
class InjectHelper {
    constructor() {
        /**
         * Registers inject helper
         * - Define request and logger in the scope of the code helper context
         * - Evaluate the response of the function passed in and return the resulting response object to HttpParser
         * @returns {void}
         */
        this.register = () => {
            handlebars_1.default.registerHelper("inject", (context) => {
                /* eslint-disable no-unused-vars */
                const request = context.data.root.request;
                const logger = context.data.root.logger;
                /* eslint-disable no-unused-vars */
                const result = eval(context.fn(this));
                return result;
            });
        };
    }
}
exports.InjectHelper = InjectHelper;
//# sourceMappingURL=InjectHelper.js.map