Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deco/clients/formdata.ts>formDataToProps

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
function formDataToProps
import { formDataToProps } from "https://deno.land/x/deco@1.104.2/clients/formdata.ts";

Convert a FormData instance to a javascript object.

Usage:

const formData = new FormData();
formData.append("foo", "bar");
const props = formDataToProps(formData);
console.log(props); // { foo: "bar" }

Parameters

formData: FormData

FormData instance to convert.

Returns

Record<string, any>

javascript object with the given FormData.