0.1.2 #3
@@ -8,7 +8,7 @@ export const option = {
|
|||||||
z.union([option.some(schema), option.none(schema)]),
|
z.union([option.some(schema), option.none(schema)]),
|
||||||
|
|
||||||
some: <S extends z.ZodSchema>(schema: S) => z
|
some: <S extends z.ZodSchema>(schema: S) => z
|
||||||
.custom(v => Option.isOption(v) && Option.isSome(v), "Not an Option")
|
.custom<Option.Some<z.output<S>>>(v => Option.isOption(v) && Option.isSome(v), "Not an Option")
|
||||||
.pipe(z.object({ value: schema }).passthrough())
|
.pipe(z.object({ value: schema }).passthrough())
|
||||||
.transform<Option.Some<z.output<S>>>(identity),
|
.transform<Option.Some<z.output<S>>>(identity),
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,6 @@ import { z } from "zod"
|
|||||||
import { zodSchemaClass } from "./builders/ZodSchemaClassBuilder"
|
import { zodSchemaClass } from "./builders/ZodSchemaClassBuilder"
|
||||||
import { dejsonify, jsonify } from "./schema/jsonifiable"
|
import { dejsonify, jsonify } from "./schema/jsonifiable"
|
||||||
import { MobXObservableZodSchemaObject } from "./traits/MobXObservableZodSchemaObject"
|
import { MobXObservableZodSchemaObject } from "./traits/MobXObservableZodSchemaObject"
|
||||||
import { effect } from "./schema/effect"
|
|
||||||
|
|
||||||
|
|
||||||
const stringOption = effect.option.option(z.string())
|
|
||||||
type T = z.output<typeof stringOption>
|
|
||||||
|
|
||||||
|
|
||||||
const exp = zodSchemaClass
|
const exp = zodSchemaClass
|
||||||
|
|||||||
Reference in New Issue
Block a user