Valibot Pipe Inference (#31)
- Fixes Pipe inference on Valibot 1.x, noting additional `readonly` constraint added post 1.0.
This commit is contained in:
committed by
GitHub
parent
978cb5d962
commit
d428962694
@@ -743,7 +743,7 @@ function FromVoid(type: BaseSchema): t.TSchema {
|
||||
// prettier-ignore
|
||||
type TFromType<Type extends BaseSchema> = (
|
||||
// Pipes - Extract First Type And Remap
|
||||
Type extends { pipe: [infer Type extends BaseSchema, ...any[]] } ? TFromType<Type> :
|
||||
Type extends { pipe: readonly [infer Type extends BaseSchema, ...any[]] } ? TFromType<Type> :
|
||||
// Types
|
||||
Type extends v.AnySchema ? TFromAny<Type> :
|
||||
Type extends v.ArraySchema<infer Type extends BaseSchema, any> ? TFromArray<Type> :
|
||||
|
||||
Reference in New Issue
Block a user