Comments (2)
I'm not 100% sure, but I don't think Zodix will work with files because it uses the URLSearchParams
trick to parse the FormData
. The code is here: https://github.com/rileytomasek/zodix/blob/master/src/parsers.ts#L172
If you can think of a simple way to add support, I'd be open to a PR, otherwise you may have to get the file from the FormData
separately and handle validation directly with Zod.
from zodix.
Ok, thanks! I was wondering whether I was doing something wrong 😅
The URLSearchParams
trick indeed explains the "[object File]"
string in the console output as explained on the UrlSearchParams MDN page :
A literal sequence of name-value string pairs, or any object — such as a FormData object — with an iterator that produces a sequence of string pairs. Note that File entries will be serialized as [object File] rather than as their filename (as they would in an application/x-www-form-urlencoded form).
I will look into it and let you know if I find a way to make it work without adding too much overhead.
from zodix.
Related Issues (19)
- Add docs for error handling
- Ability to parse array from FormData HOT 5
- [BUG] TypeError: keyValidator._parse is not a function HOT 13
- `zx.parseFormSafe` type inference does not handle `ZodEffects` HOT 1
- Support asynchronous parsing HOT 1
- Support other runtimes HOT 1
- Custom error messages for helpers? HOT 2
- zx.parseQuery errors in component using SSR HOT 4
- Zodix modifying FormData objects
- Release v0.4.2 HOT 1
- [BUG]: Typescript compilation fails in Remix V2 HOT 1
- BUG: @remix-run/server-runtime peer dependency not compatible with remix v2
- Add a `zx.DateAsString`
- Destructuring parsing result
- Set up GitHub Actions to run tests for PRs
- Add `/examples` with Remix app for examples
- Add support for Zod `.safeParse()`
- Add `.parseAction()` and `.parseLoader()` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zodix.