Created
April 25, 2018 14:55
-
-
Save andrIvash/507d16d5189ec1ab47e8c259d341973a to your computer and use it in GitHub Desktop.
formDataToJSON
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
| export default function formDataToJSON(formData) { | |
| const data = {}; | |
| for (const key of formData.keys()) { | |
| data[key] = formData.get(key); | |
| } | |
| return data; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment