Skip to content

Commit

Permalink
fix: Rename pcb_hole.hole_shape "round" to "circle" and add zod tra…
Browse files Browse the repository at this point in the history
…nsform
  • Loading branch information
Your Name (aider) committed Sep 6, 2024
1 parent 9125edf commit 14f8d3a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pcb/pcb_hole.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { z } from "zod"
import { distance } from "../units"

const holeShapeEnum = z.enum(["circle", "square"])

export const pcb_hole = z
.object({
pcb_hole_id: z.string(),
type: z.literal("pcb_hole"),
hole_shape: z.enum(["round", "square"]).default("round"),
hole_shape: holeShapeEnum.default("circle").transform((shape) => {
if (shape === "round") return "circle"
return shape
}),
hole_diameter: z.number(),
x: distance,
y: distance,
Expand Down

0 comments on commit 14f8d3a

Please sign in to comment.