const zlib=require("zlib"),util=require("util"),querystring=require("querystring");Object.assign(exports,{gzip:util.promisify(zlib.gzip)}),exports.getPostData=(e=>new Promise((i,t)=>{let a="";e.on("data",function(e){a+=e}),e.on("end",function(){let t;switch(e.headers["content-type"]){case"application/x-www-form-urlencoded":t=querystring.parse(a);break;case"application/json":t=JSON.parse(a);break;case"text/plain":t=a;break;case"b64json":let i=(t=JSON.parse(a)).file.replace(/^data:image\/\w+;base64,/,"");t.file=new Buffer(i,"base64")}i(t)})}));