Skip to content

Commit

Permalink
Filter form data
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianscheit committed Feb 6, 2025
1 parent 7bde16c commit 4f4a3af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Frame } from "./frame";

export const extractFormData = <T>(form: any): T => {
return Object.fromEntries(
[...form].map((it: any): [string, string] => [it.name, it.value])
[...form].filter((it) => it.name).map((it: any): [string, string] => [it.name, it.value])
) as T;
};
export const setFormData = (form: any, data: any): void => {
Expand Down

0 comments on commit 4f4a3af

Please sign in to comment.