From 5e7588510da440a5c61085521ccf85d0c94a79bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Tue, 19 Mar 2024 17:44:46 +0100 Subject: [PATCH] Option fix --- src/schema/effect/option.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/schema/effect/option.ts b/src/schema/effect/option.ts index 53b6abf..98ff4bc 100644 --- a/src/schema/effect/option.ts +++ b/src/schema/effect/option.ts @@ -4,17 +4,17 @@ import { z } from "zod" export const option = { - option: (schema: S) => + option: (schema: S) => z.union([option.some(schema), option.none(schema)]), - some: (schema: S) => z + some: (schema: S) => z .custom>>(v => Option.isOption(v) && Option.isSome(v), "Not an Option") .pipe(z.object({ value: schema }).passthrough()) .transform>>(identity), - none: (_schema?: S) => + none: (_schema?: S) => z.custom : unknown >>(v => Option.isOption(v) && Option.isNone(v), "Not an Option"),