function formDataToJson(formData){ let json = {}; if(!(formData instanceof FormData)) return json; formData.forEach((value,key)=>{ json[key] = value; }); return json; }