Created
January 16, 2020 16:06
-
-
Save rt2zz/4509eca6a89daa754f5053506edbc87c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formDataFrom(obj: { [key: string]: string | number }) { | |
let formData = new FormData() | |
for (let key in obj) { | |
formData.append(key, String(obj[key])) | |
} | |
return formData | |
} | |
export default formDataFrom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment