@tscircuit/footprinter 0.0.210 → 0.0.212

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
@@ -295,11 +295,11 @@ var footprintSizes = [
295
295
  {
296
296
  imperial: "1812",
297
297
  metric: "4532",
298
- p_mm_min: 4.1,
299
- pw_mm_min: 1.4,
298
+ p_mm_min: 4.275,
299
+ pw_mm_min: 1.125,
300
300
  ph_mm_min: 3.4,
301
- w_mm_min: 0.58,
302
- h_mm_min: 0.21
301
+ w_mm_min: 5.4,
302
+ h_mm_min: 3.4
303
303
  },
304
304
  {
305
305
  imperial: "0201",
@@ -7202,11 +7202,11 @@ var applyOrigin = (elements, origin) => {
7202
7202
  var string2 = (def) => {
7203
7203
  let fp2 = footprinter();
7204
7204
  const modifiedDef = def.replace(/^((?:\d{4}|\d{5}))(?=$|_)/, "res$1");
7205
- const def_parts = modifiedDef.split("_").map((s) => {
7205
+ const def_parts = modifiedDef.split(/_(?!metric)/).map((s) => {
7206
7206
  const m = s.match(/([a-z]+)([\(\d\.\+\?].*)?/);
7207
7207
  const [_, fn, v] = m ?? [];
7208
7208
  if (v?.includes("?")) return null;
7209
- return { fn, v: m?.[2] };
7209
+ return { fn, v };
7210
7210
  }).filter(isNotNull);
7211
7211
  for (const { fn, v } of def_parts) {
7212
7212
  fp2 = fp2[fn](v);
@@ -7286,7 +7286,11 @@ var footprinter = () => {
7286
7286
  target.fn = prop;
7287
7287
  if (prop === "res" || prop === "cap") {
7288
7288
  if (v) {
7289
- target.imperial = v;
7289
+ if (typeof v === "string" && v.includes("_metric")) {
7290
+ target.metric = v.split("_metric")[0];
7291
+ } else {
7292
+ target.imperial = v;
7293
+ }
7290
7294
  }
7291
7295
  } else {
7292
7296
  target.num_pins = Number.isNaN(Number.parseFloat(v)) ? void 0 : Number.parseFloat(v);