cloudaxe-opencode/packages/opencode/src/server/routes/instance/httpapi/groups/query.ts

13 lines
417 B
TypeScript
Raw Normal View History

import { Schema, SchemaGetter } from "effect"
export const QueryBoolean = Schema.Literals(["true", "false"]).pipe(
Schema.decodeTo(Schema.Boolean, {
decode: SchemaGetter.transform((value) => value === "true"),
encode: SchemaGetter.transform((value) => (value ? "true" : "false")),
}),
)
2026-05-10 15:57:52 +00:00
export const QueryBooleanOpenApi = {
anyOf: [{ type: "boolean" }, { type: "string", enum: ["true", "false"] }],
}