mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-17 12:56:41 +02:00
17 lines
470 B
TypeScript
17 lines
470 B
TypeScript
import { Schema } from "effect"
|
|
import z from "zod"
|
|
|
|
import { withStatics } from "@/util/schema"
|
|
|
|
const projectIdSchema = Schema.String.pipe(Schema.brand("ProjectId"))
|
|
|
|
export type ProjectID = typeof projectIdSchema.Type
|
|
|
|
export const ProjectID = projectIdSchema.pipe(
|
|
withStatics((schema: typeof projectIdSchema) => ({
|
|
global: schema.makeUnsafe("global"),
|
|
make: (id: string) => schema.makeUnsafe(id),
|
|
zod: z.string().pipe(z.custom<ProjectID>()),
|
|
})),
|
|
)
|