import {
  getCurrentPageUrl,
  getCurrentPageParam
} from "./getUrl"
function formatUrl(){
  let redirectUrl=getCurrentPageUrl();
  let options=getCurrentPageParam();
  let params="";
  let url='';
  for (const key in options) {
    if(params){
      params=params+'&'+key+'='+options[key];
    }else{
      params=params+key+'='+options[key];
    }
  };
  if(params){
    url=redirectUrl+"?"+params
  }else{
    url=redirectUrl
  }
  return encodeURIComponent(url);
}
module.exports={
  formatUrl
}