Skip to content

Another notation for FormDataInfo  #5

Description

@sean-nicholas

What do you thing about a new notation for FormDataInfo? Something that looks more like the object that will get returned:

const formValues = decode(formData, {
  title: 'string',
  price: 'number',
  created: 'date',
  active: 'boolean',
  tags: ['string'],
  images: [{
      title: 'string',
      created: 'date',
      file: 'file',
    }]
  ,
});

Benefits:

  • imho the DX is better: I know how my object should look like in the end. Its way easier to write down the object compared to paths where I want a transformation to happen.
  • It pretty much looks like a valibot / zod schema. So switching between "pure" FormDataInfo and a Schema is super easy

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions