@tscircuit/footprinter 0.0.230 → 0.0.232

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
@@ -7195,7 +7195,7 @@ var m2host = (raw_params) => {
7195
7195
 
7196
7196
  // src/helpers/is-not-null.ts
7197
7197
  function isNotNull(value) {
7198
- return value !== null;
7198
+ return value !== null && value !== void 0;
7199
7199
  }
7200
7200
 
7201
7201
  // src/helpers/apply-origin.ts
@@ -7270,12 +7270,22 @@ var applyOrigin = (elements, origin) => {
7270
7270
  break;
7271
7271
  }
7272
7272
  if (dx === 0 && dy === 0) return elements;
7273
- for (const pad2 of pads) {
7274
- pad2.x -= dx;
7275
- pad2.y -= dy;
7276
- if (pad2.center) {
7277
- pad2.center.x -= dx;
7278
- pad2.center.y -= dy;
7273
+ for (const el of elements) {
7274
+ if (typeof el.x === "number") el.x -= dx;
7275
+ if (typeof el.y === "number") el.y -= dy;
7276
+ if (el.center && typeof el.center.x === "number") {
7277
+ el.center.x -= dx;
7278
+ el.center.y -= dy;
7279
+ }
7280
+ if (el.type === "pcb_silkscreen_path") {
7281
+ for (const pt of el.route) {
7282
+ pt.x -= dx;
7283
+ pt.y -= dy;
7284
+ }
7285
+ }
7286
+ if (el.type === "pcb_silkscreen_text" && el.anchor_position) {
7287
+ el.anchor_position.x -= dx;
7288
+ el.anchor_position.y -= dy;
7279
7289
  }
7280
7290
  }
7281
7291
  return elements;
@@ -7287,8 +7297,9 @@ var string2 = (def) => {
7287
7297
  const modifiedDef = def.replace(/^((?:\d{4}|\d{5}))(?=$|_)/, "res$1");
7288
7298
  const def_parts = modifiedDef.split(/_(?!metric)/).map((s) => {
7289
7299
  const m = s.match(/([a-z]+)([\(\d\.\+\?].*)?/);
7290
- const [_, fn, v] = m ?? [];
7291
- if (v?.includes("?")) return null;
7300
+ if (!m) return null;
7301
+ const [, fn, v] = m;
7302
+ if (!fn || v?.includes("?")) return null;
7292
7303
  return { fn, v };
7293
7304
  }).filter(isNotNull);
7294
7305
  for (const { fn, v } of def_parts) {