wretch
Version:
A tiny wrapper built around fetch with an intuitive syntax.
3 lines (2 loc) • 665 B
JavaScript
var global,factory;global=this,factory=function(){function o(o,e){return encodeURIComponent(o)+"="+encodeURIComponent("object"==typeof e?JSON.stringify(e):""+e)}return{wretch:{formUrl(e){return this.body("string"==typeof e?e:(t=e,Object.keys(t).map((e=>{const n=t[e];return n instanceof Array?n.map((t=>o(e,t))).join("&"):o(e,n)})).join("&"))).content("application/x-www-form-urlencoded");var t}}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global="undefined"!=typeof globalThis?globalThis:global||self).wretchFormUrlAddon=factory();
//# sourceMappingURL=formUrl.min.js.map