refactor(core): derive all schema.ts leaves' .zod via effect-zod walker (#23754)
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { Schema } from "effect"
|
||||
import z from "zod"
|
||||
|
||||
import { Identifier } from "@/id/id"
|
||||
import { ZodOverride } from "@/util/effect-zod"
|
||||
import { zod, ZodOverride } from "@/util/effect-zod"
|
||||
import { withStatics } from "@/util/schema"
|
||||
|
||||
const toolIdSchema = Schema.String.annotate({ [ZodOverride]: Identifier.schema("tool") }).pipe(Schema.brand("ToolID"))
|
||||
@@ -12,6 +11,6 @@ export type ToolID = typeof toolIdSchema.Type
|
||||
export const ToolID = toolIdSchema.pipe(
|
||||
withStatics((schema: typeof toolIdSchema) => ({
|
||||
ascending: (id?: string) => schema.make(Identifier.ascending("tool", id)),
|
||||
zod: Identifier.schema("tool").pipe(z.custom<ToolID>()),
|
||||
zod: zod(schema),
|
||||
})),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user