"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getXhttp = exports.withXhttp = void 0;
const axios_1 = __importDefault(require("axios"));
const HTTP_ID_KEY = "ctx-key-http-id";
const withXhttp = (ctx, axios) => {
    return Object.assign(Object.assign({}, ctx), { [HTTP_ID_KEY]: axios });
};
exports.withXhttp = withXhttp;
const getXhttp = (ctx) => {
    const l = ctx[HTTP_ID_KEY];
    if (l == undefined) {
        return axios_1.default.create();
    }
    return l;
};
exports.getXhttp = getXhttp;
//# sourceMappingURL=context.js.map