You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible that this is a misunderstanding as well: default works like JavaScript default assignment in destructuring: it replaces undefined with the default value. So if you input schema is nullable, adding a default does not make it non-nullable, it just allows the input to be optional (T | undefined) and makes the output non-optional (T).
Closing since this is working as intended, but feel free to post follow-up questions!
If I call
.default()
, why does it make the output type nullable? If I have provided a default value, shouldn't the output never benull
?The text was updated successfully, but these errors were encountered: