mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-22 05:42:35 +08:00
refactor(config): drop ZodOverride from PositiveInt in provider.ts (#23215)
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { Schema } from "effect"
|
||||
import z from "zod"
|
||||
import { zod, ZodOverride } from "@/util/effect-zod"
|
||||
import { zod } from "@/util/effect-zod"
|
||||
import { withStatics } from "@/util/schema"
|
||||
|
||||
// Positive integer preserving exact Zod JSON Schema (type: integer, exclusiveMinimum: 0).
|
||||
const PositiveInt = Schema.Number.annotate({
|
||||
[ZodOverride]: z.number().int().positive(),
|
||||
})
|
||||
// Positive integer: emits JSON Schema `type: integer, exclusiveMinimum: 0`
|
||||
// via the effect-zod walker's well-known refinement translation.
|
||||
const PositiveInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0))
|
||||
|
||||
export const Model = Schema.Struct({
|
||||
id: Schema.optional(Schema.String),
|
||||
|
||||
Reference in New Issue
Block a user