easyeda 0.0.18 → 0.0.20

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.
@@ -28870,7 +28870,10 @@ var ShapeItemSchema = import_zod.z.object({
28870
28870
  }
28871
28871
  case "SOLIDREGION": {
28872
28872
  const [layermask, , pathData, fillStyle, id] = shape.data.split("~");
28873
- const points = pathData.match(/[ML] ?([\d.]+[ ,][\d.]+)/g).map((point) => point.slice(2).split(/[ ,]/).map(Number));
28873
+ const points = pathData.match(/[ML] ?(-?[\d.]+)[ ,](-?[\d.]+)/g)?.map((point) => {
28874
+ const [, x, y] = point.match(/[ML]? ?(-?[\d.]+)[ ,](-?[\d.]+)/) || [];
28875
+ return [Number(x), Number(y)];
28876
+ }) || [];
28874
28877
  return SolidRegionSchema.parse({
28875
28878
  type: "SOLIDREGION",
28876
28879
  layermask: Number(layermask),
@@ -29568,7 +29571,8 @@ var convertToTypescriptComponent = ({
29568
29571
  soup,
29569
29572
  easyeda: easyEdaJson
29570
29573
  }) => {
29571
- const pn = easyEdaJson.lcsc.number;
29574
+ const rawPn = easyEdaJson.dataStr.head.c_para["Manufacturer Part"];
29575
+ const pn = normalizeManufacturerPartNumber(rawPn);
29572
29576
  const [cad_component2] = (0, import_soup_util2.su)(soup).cad_component.list();
29573
29577
  const smtpads = (0, import_soup_util2.su)(soup).pcb_smtpad.list();
29574
29578
  const plated_holes = (0, import_soup_util2.su)(soup).pcb_plated_hole.list();
@@ -29598,6 +29602,14 @@ var convertToTypescriptComponent = ({
29598
29602
  easyEdaJson
29599
29603
  });
29600
29604
  };
29605
+ function normalizeManufacturerPartNumber(partNumber) {
29606
+ let normalized = partNumber.replace(/-/g, "_");
29607
+ normalized = normalized.replace(/[^a-zA-Z0-9_$]/g, "");
29608
+ if (/^\d/.test(normalized)) {
29609
+ normalized = "A" + normalized;
29610
+ }
29611
+ return normalized;
29612
+ }
29601
29613
  // Annotate the CommonJS export names for ESM import in node:
29602
29614
  0 && (module.exports = {
29603
29615
  convertEasyEdaJsonToTscircuitSoupJson,