@tscircuit/footprinter 0.0.132 → 0.0.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3454,26 +3454,19 @@ import {
3454
3454
  } from "circuit-json";
3455
3455
  import { z as z32 } from "zod";
3456
3456
  var to220_def = z32.object({
3457
- fn: z32.string().default("to220_3").refine((val) => /^to220_\d+$/.test(val), {
3458
- message: "Invalid format. Expected 'to220_N' where N is the number of pins."
3459
- }),
3457
+ fn: z32.string(),
3460
3458
  p: length25.optional().default("5.0mm"),
3461
3459
  id: length25.optional().default("1.0mm"),
3462
3460
  od: length25.optional().default("1.9mm"),
3463
3461
  w: length25.optional().default("13mm"),
3464
- h: length25.optional().default("7mm")
3465
- }).transform((a) => {
3466
- const match = a.fn.match(/^to220_(\d+)$/);
3467
- const numPins = match ? parseInt(match[1], 10) : 3;
3468
- return {
3469
- ...a,
3470
- numPins,
3471
- fn: "to220"
3472
- };
3462
+ h: length25.optional().default("7mm"),
3463
+ num_pins: z32.number().optional(),
3464
+ string: z32.string().optional()
3473
3465
  });
3474
3466
  var to220 = (raw_params) => {
3475
3467
  const parameters = to220_def.parse(raw_params);
3476
- const { fn, id, od, w, h, numPins } = parameters;
3468
+ const { fn, id, od, w, h, string: string2 } = parameters;
3469
+ const numPins = Number.parseInt(string2?.split("_")[1] ?? "3");
3477
3470
  const holeY = -1;
3478
3471
  const halfWidth = w / 2;
3479
3472
  const halfHeight = h / 2;