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
Why do I get key2: undefined in the output ? What's the best way to ignore them.
My use case is that upon successful parsing I want to loop over array values via Object.values(catalog).map(item => objectKeys(item)).flat() which breaks with error Cannot convert undefined or null to object
This used to work as intended with zod schema.
Unless my input is const input = {key1: {x: ["hello", "world"]}, key2: undefined} the output shouldn't contain undefined.
What's valibot's way of stripping away undefined keys ?
The text was updated successfully, but these errors were encountered:
Discussed in #196
Originally posted by xinha-sh October 4, 2023
Why do I get
key2: undefined
in the output ? What's the best way to ignore them.My use case is that upon successful parsing I want to loop over array values via
Object.values(catalog).map(item => objectKeys(item)).flat()
which breaks with errorCannot convert undefined or null to object
This used to work as intended with zod schema.
Unless my input is
const input = {key1: {x: ["hello", "world"]}, key2: undefined}
the output shouldn't contain undefined.What's valibot's way of stripping away undefined keys ?
The text was updated successfully, but these errors were encountered: