index.js
584 Bytes
/*!
* fant-axios-adapter v0.0.6
* 2023 weisheng
*/
function t(t,n,c){return t.replace(RegExp(n,"g"),c)}function n(n){return n=t(n,"//","/"),n=t(n,"https:/","https://"),n=t(n,"http:/","http://")}function c(t){var n=new Map,c=t.split("?"),e="",r=[];c.length>1&&(e=c[1]),r=e.split("&");for(var p=0;r.length>p;p++)2===r[p].split("=").length&&n.set(r[p].split("=")[0],r[p].split("=")[1]);return n}function e(t,n){return n.forEach((function(n,c){t.indexOf("?")>-1?t+="&".concat(c,"=").concat(n):t+="?".concat(c,"=").concat(n)})),t}export{n as beautifyUrl,c as getParams,e as setParams};