Object to form
Convert an object to formdata
Install
$ npm install --save object-to-form
Usage
Convert an object
// 3.- ES2015 ; let obj = name: 'myName' list: 'Item1' 'Item2' 'Item3' address: street: 'myStreet' photo: // File object ; let formData = ;
You can pass a formdata previously created
// 3.- ES2015 ; // formdata previously created. let previousFormData = ; // the previous formdata can has fields added previousFormData; let obj = name: 'myName' list: 'Item1' 'Item2' 'Item3' address: street: 'myStreet' photo: // File object ; // pass the previous formdata let formData = ;
NOTE: This package supports FileList on properties
// For Example let obj = // FileList myFiles: ;
Issues
Repository
NOTE: The source code code is in typescript and transpilated to Javascript. If you wish colaborate, you can make a pull request on Github.
You can execute this command for build
$ npm run build