From 046355bc34c58b13223daa5c6c873c4076e26fa9 Mon Sep 17 00:00:00 2001 From: seveibar Date: Thu, 7 May 2026 20:40:33 -0700 Subject: [PATCH] attempt to simplify typecheck --- generated/COMPONENT_TYPES.md | 2 +- lib/components/resistor.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/generated/COMPONENT_TYPES.md b/generated/COMPONENT_TYPES.md index c0738d6..dca59a0 100644 --- a/generated/COMPONENT_TYPES.md +++ b/generated/COMPONENT_TYPES.md @@ -3215,7 +3215,7 @@ export interface ResistorProps connections?: Connections } export const resistorProps = commonComponentProps.extend({ - footprint: footprintProp.optional().transform(mapResistorFootprint), + footprint: resistorFootprintProp, resistance, tolerance: z .union([z.string(), z.number()]) diff --git a/lib/components/resistor.ts b/lib/components/resistor.ts index 7e653da..a0de3b8 100644 --- a/lib/components/resistor.ts +++ b/lib/components/resistor.ts @@ -57,8 +57,13 @@ const mapResistorFootprint = ( if (!resistorImperialFootprintNames.has(footprint)) return footprint return `res${footprint}` } + +const resistorFootprintProp: z.ZodType = footprintProp + .optional() + .transform(mapResistorFootprint) + export const resistorProps = commonComponentProps.extend({ - footprint: footprintProp.optional().transform(mapResistorFootprint), + footprint: resistorFootprintProp, resistance, tolerance: z .union([z.string(), z.number()])