From d4289626943b01e6833edfe00ecef8d5db1f3d88 Mon Sep 17 00:00:00 2001 From: Kavishka Ganganatha Date: Tue, 3 Jun 2025 13:39:31 +0530 Subject: [PATCH] Valibot Pipe Inference (#31) - Fixes Pipe inference on Valibot 1.x, noting additional `readonly` constraint added post 1.0. --- src/typebox/typebox-from-valibot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/typebox/typebox-from-valibot.ts b/src/typebox/typebox-from-valibot.ts index 4a51750..31a1da9 100644 --- a/src/typebox/typebox-from-valibot.ts +++ b/src/typebox/typebox-from-valibot.ts @@ -743,7 +743,7 @@ function FromVoid(type: BaseSchema): t.TSchema { // prettier-ignore type TFromType = ( // Pipes - Extract First Type And Remap - Type extends { pipe: [infer Type extends BaseSchema, ...any[]] } ? TFromType : + Type extends { pipe: readonly [infer Type extends BaseSchema, ...any[]] } ? TFromType : // Types Type extends v.AnySchema ? TFromAny : Type extends v.ArraySchema ? TFromArray :