From 051bd1ac49d9391bfd24f888e88328e1fc8d5ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99drzy=C5=84ski?= Date: Fri, 10 Jan 2025 15:02:35 +0100 Subject: [PATCH] feat(zchema): added InferOr type --- packages/zchema/src/Schema.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/zchema/src/Schema.ts b/packages/zchema/src/Schema.ts index 55c124b..e1d9222 100644 --- a/packages/zchema/src/Schema.ts +++ b/packages/zchema/src/Schema.ts @@ -57,6 +57,8 @@ export type InferNonNull = // eslint-disable-next-line @typescript-eslint/no-explicit-any TSchema extends Schema ? V : never; +export type InferOr = TSchema extends Schema ? Infer : T; + export type Infer = // eslint-disable-next-line @typescript-eslint/no-explicit-any TSchema extends Schema