Closed laneme closed 1 month ago
const OptionalStringSchema = v.object({ cake: v.optional(v.string(), "Chocolate!"), }) const defaultValue = v.getDefault(OptionalStringSchema) console.info(defaultValue) // undefined
Its even typed undefined. Is this something not implemented yet?
It works with the primitives tho
v.getDefault(OptionalStringSchema.entries.cake) // Chocolate
Versions
"valibot": "^0.42.1", "typescript": "~5.6.3",
Please have a look at getDefaults: https://valibot.dev/api/getDefaults/
getDefaults
Silly me just ignoring the letter s. Ty ^^
s
Its even typed undefined. Is this something not implemented yet?
It works with the primitives tho
Versions