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()])