"use strict";const u=require("../utils.js"),m=(s,e,a)=>{const t={};return s.forEach(d=>{u.isUndefined(a[d])?u.isUndefined(e[d])||(t[d]=e[d]):t[d]=a[d]}),t},h=(s,e={})=>{const a=e.method||s.method||"GET";let t={baseURL:s.baseURL||"",method:a,url:e.url||"",params:e.params||{},custom:{...s.custom||{},...e.custom||{}},header:u.deepMerge(s.header||{},e.header||{})};return t={...t,...m(["getTask","validateStatus"],s,e)},a==="DOWNLOAD"||(a==="UPLOAD"?(delete t.header["content-type"],delete t.header["Content-Type"],["filePath","name","formData"].forEach(r=>{u.isUndefined(e[r])||(t[r]=e[r])})):t={...t,...m(["data","timeout","dataType","responseType"],s,e)}),t};exports.mergeConfig=h;
