@tuentyfaiv/http
Version:
Library for http requests based on fetch
2 lines (1 loc) • 470 B
JavaScript
function o(o){Object.keys(o).forEach((e=>{const t=e,c=o[t];if("request"===t){const o=Object.fromEntries(c.headers.entries());console.log("%cHEADERS:","color: #00b894; font-weight: bold;",o),console.log("%cBODY:","color: #00b894; font-weight: bold;",c.body),console.log("%cMETHOD:","color: #00b894; font-weight: bold;",c.method)}else{const o="url"===t?"endpoint":`${t}`;console.log(`%c${o.toUpperCase()}:`,"color: #00b894; font-weight: bold;",c)}}))}export{o as logger};