UNPKG

@odata2ts/http-client-axios

Version:

Axios based odata HTTP client consumable by odata2ts

20 lines 720 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mergeConfig = void 0; const tslib_1 = require("tslib"); function mergeConfig(...configs) { if (!configs.length) { return undefined; } return configs .filter((c) => !!c) .reduce((collector, current) => { const { headers } = current, passThrough = tslib_1.__rest(current, ["headers"]); if (headers) { Object.entries(headers).forEach(([key, val]) => (collector.headers[key] = val)); } return Object.assign(Object.assign({}, collector), passThrough); }, { headers: {} }); } exports.mergeConfig = mergeConfig; //# sourceMappingURL=AxiosRequestConfig.js.map