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"),