wretch
Version:
A tiny wrapper built around fetch with an intuitive syntax.
2 lines • 416 B
JavaScript
function e(e,t){return encodeURIComponent(e)+`=`+encodeURIComponent(typeof t==`object`?JSON.stringify(t):``+t)}function t(t){return Object.keys(t).map(n=>{let r=t[n];return r instanceof Array?r.map(t=>e(n,t)).join(`&`):e(n,r)}).join(`&`)}const n={wretch:{formUrl(e){return this.body(typeof e==`string`?e:t(e)).content(`application/x-www-form-urlencoded`)}}};module.exports=n;
//# sourceMappingURL=formUrl.min.cjs.map