Skip to content

Commit

Permalink
Update dom.ts
Browse files Browse the repository at this point in the history
simplify getFormEncType checking
  • Loading branch information
lifeiscontent authored and edmundhung committed Jun 26, 2023
1 parent eccf505 commit d52ecb1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/conform-dom/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ export function getFormEncType(
const submitter = event.submitter as Submitter | null;
const encType = submitter?.getAttribute('formenctype') ?? form.enctype;

if (
['application/x-www-form-urlencoded', 'multipart/form-data'].includes(
encType,
)
) {
return encType as any;
if (encType === 'multipart/form-data') {
return encType;
}

return 'application/x-www-form-urlencoded';
Expand Down

0 comments on commit d52ecb1

Please sign in to comment.