-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null / undefined handling #105
null / undefined handling #105
Comments
+1 |
@TheYoxy actually I don't think this can be done in
What is really desired here is something that conform does with parseWithZod |
Null works already when used together with |
That's a good point regarding "null". So basically, theskillwithin#1 should do what we want (filter "undefined" in createFormData before putting the data into FormData and sending it). |
@here fixed with 5.1.0, from this version onwards undefined values are ignored and not sent over the wire as they are not really useful in any way, null values are still serialized and the reason behind this is that sending null to your database might mean a whole different thing than just not sending anything so you might want the null to be there to remove some set values. I would recommend handling the null values in your own code if you want to ignore them |
As is, when you create a form data with a value that has been defined with a value, even values that represents nothing (
null
andundefined
), it gets serialized in string.Wouldn't it be better to ignore theses values or return the raw underlined type ?
One idea of test implementation in the case that the choice is to handle base type:
The text was updated successfully, but these errors were encountered: