Closed declanlscott closed 2 months ago
This is a bug. Thank you for creating this PR. It seems to happen whenever pipeAsync
contains an async action, but I think I could fix it by changing the following code in the IssueDotPath
type:
-TSchema extends SchemaWithPipe<infer TPipe> | SchemaWithPipeAsync<infer TPipe>
- ? IssueDotPath<FirstTupleItem<TPipe>>
- : ...
+TSchema extends SchemaWithPipe<infer TPipe>
+ ? IssueDotPath<FirstTupleItem<TPipe>>
+ : TSchema extends SchemaWithPipeAsync<infer TPipe>
+ ? IssueDotPath<FirstTupleItem<TPipe>>
+ : ...
Before releasing a new version, I need to investigate if the same happens for other parts of the IssueDotPath
type.
This will be fixed with the next release
v0.42.0 is available
Thank you for creating this excellent library! This is the first time I've come across any issue after using valibot for some time.
Issue
When using the
getDotPath
function with an async pipe schema, the resulting return type isnull
. I have verified this is not the behavior when using a non-async pipe schema.Minimal reproduction
I also created a minimal reproduction in the playground where you can see hovering over the
issuePaths
variable revealsnull[]
. The function returns the correct values, as shown in the logs after running the playground, but the return type is not consistent with this.Investigation
I did some preliminary investigation and it seems like the condition in the first line of the
IssueDotPath
type definition fails, eventually resolving the type tonever
. I'm not sure why this would be happening though?If this is the expected behavior or if I'm missing something in my implementation, please let me know!