We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For any valibot schema that uses intersect, InferInput always infers intersect as type never
InferInput
intersect
never
For the below code, the v.InferInput infers typeof eventSchema as never
v.InferInput
typeof eventSchema
This started in the first pre-release v0.31.0-rc.0 and still happens in the latest pre-release v0.31.0-rc.4
import * as v from 'valibot' const eventSchema = v.intersect([ v.pipe( v.object({ name: v.pipe( v.string(), v.trim(), v.maxLength(128), ), startDate: v.date(), endDate: v.date(), }), v.check(({ startDate, endDate }) => startDate < endDate), ), v.variant('hasCelebrity', [ v.object({ hasCelebrity: v.literal(true), celebrity: v.literal('Fabian Hiller'), }), v.object({ hasCelebrity: v.literal(false), celebrity: v.null_(), }), ]), ]) type EventSchemaT = v.InferInput<typeof eventSchema> // infers as 'never' (all the time)
The text was updated successfully, but these errors were encountered:
Fix input and output type of intersect schema #601
f855726
Thanks for reporting this. I will fix it and release a new version.
Sorry, something went wrong.
8b2130c
v0.31.0-rc.5 is available
Many Thanks @fabian-hiller You're a super star ⭐
88471b2
fabian-hiller
No branches or pull requests
For any valibot schema that uses intersect,
InferInput
always infersintersect
as typenever
For the below code, the
v.InferInput
inferstypeof eventSchema
asnever
This started in the first pre-release v0.31.0-rc.0 and still happens in the latest pre-release v0.31.0-rc.4
Screenshot from VSCode Intellisense
The text was updated successfully, but these errors were encountered: