Skip to content

Commit

Permalink
removed literal prop types (#104)
Browse files Browse the repository at this point in the history
+removed num_pins from axial as it only has two
  • Loading branch information
ShiboSoftwareDev authored Jan 5, 2025
1 parent c3d3b77 commit 9d74946
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/fn/axial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { silkscreenRef, type SilkscreenRef } from "../helpers/silkscreenRef"

export const axial_def = z.object({
fn: z.string(),
num_pins: z.literal(2).default(2),
p: length.optional().default("2.54mm"),
id: length.optional().default("0.7mm"),
od: length.optional().default("1mm"),
Expand Down
1 change: 0 additions & 1 deletion src/fn/dip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const extendDipDef = (newDefaults: { w?: string; p?: string }) =>
z
.object({
fn: z.string(),
dip: z.literal(true),
num_pins: z.number().optional().default(6),
wide: z.boolean().optional(),
narrow: z.boolean().optional(),
Expand Down
8 changes: 4 additions & 4 deletions src/fn/pushbutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"

export const pushbutton_def = z.object({
fn: z.literal("pushbutton"),
w: z.literal(4.5).default(4.5),
h: z.literal(6.5).default(6.5),
id: z.literal(1).default(1),
od: z.literal(1.2).default(1.2),
w: z.number().default(4.5),
h: z.number().default(6.5),
id: z.number().default(1),
od: z.number().default(1.2),
})

export const pushbutton = (
Expand Down
4 changes: 2 additions & 2 deletions src/fn/quad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { type SilkscreenRef, silkscreenRef } from "src/helpers/silkscreenRef"

export const base_quad_def = z.object({
fn: z.string(),
cc: z.literal(true).optional(),
ccw: z.literal(true).optional(),
cc: z.boolean().default(true).optional(),
ccw: z.boolean().default(true).optional(),
startingpin: z
.string()
.or(z.array(pin_order_specifier))
Expand Down

0 comments on commit 9d74946

Please sign in to comment.