Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
make-form-data
Advanced tools
Helper function that recursively turns plain JS object into FormData instance
Helper function that recursively turns plain JS object into FormData instance
npm: npm i make-form-data
yarn: yarn add make-form-data
Function handles your data recursively, which means you can mix-and-match your values and nest them however you need to.
import makeFormData from "make-form-data";
const data = {
// supports arrays
favours: [
'coding',
{
type: 'activity',
name: 'snowboarding',
},
'serfing',
],
// supports objects
images: {
some: 'object',
info: 'here',
},
// supports File instances
file: new File(['some file contents'], 'my-text-file.txt'),
// booleans turn into '1' or empty string
truthyBoolean: true, // => '1'
falsyBoolean: false, // => ''
// null values also turn into empty strings
nullable: null, // => ''
/**
* Everything else is handled by FormData.append()
* @see https://developer.mozilla.org/en-US/docs/Web/API/FormData/append
*/
};
const formData = makeFormData(data);
FAQs
Helper function that recursively turns plain JS object into FormData instance
We found that make-form-data demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.