wretch
Version:
A tiny wrapper built around fetch with an intuitive syntax.
2 lines • 615 B
JavaScript
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.wretchFormUrlAddon=t())})(this,function(){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(`&`)}return{wretch:{formUrl(e){return this.body(typeof e==`string`?e:t(e)).content(`application/x-www-form-urlencoded`)}}}});
//# sourceMappingURL=formUrl.min.js.map