easyeda 0.0.389 → 0.0.391

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/main.cjs CHANGED
@@ -1078,7 +1078,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
1078
1078
  var package_default = {
1079
1079
  name: "easyeda",
1080
1080
  type: "module",
1081
- version: "0.0.388",
1081
+ version: "0.0.389",
1082
1082
  files: [
1083
1083
  "dist"
1084
1084
  ],
@@ -18720,8 +18720,11 @@ var PinShapeOutputSchema = import_zod247.z.object({
18720
18720
  });
18721
18721
  var parsePin = (pinString) => {
18722
18722
  const parts = pinString.split("~");
18723
- const [, visibility, , pinNumber, x, y, rotation2, id] = parts;
18724
- const pinNameSection = pinString.split("^^")[3];
18723
+ const [, visibility, , spicePinNumber, x, y, rotation2, id] = parts;
18724
+ const sections = pinString.split("^^");
18725
+ const physicalPinNumber = sections[4]?.split("~")[4]?.trim();
18726
+ const pinNumber = physicalPinNumber && !["undefined", "null"].includes(physicalPinNumber.toLowerCase()) ? physicalPinNumber : spicePinNumber;
18727
+ const pinNameSection = sections[3];
18725
18728
  let label = pinNameSection?.split("~")[4] ?? "";
18726
18729
  if (!label.includes("/")) label = normalizeEasyEdaPinLabel(label);
18727
18730
  const colorMatch = pinString.match(/#[0-9A-F]{6}/);
@@ -20305,6 +20308,7 @@ var isPushbuttonCategoryComponent = (betterEasy) => {
20305
20308
 
20306
20309
  // lib/websafe/convert-to-typescript-component/is-resistor-component.ts
20307
20310
  var standardSmdResistorPackagePattern = /^R(?:01005|0201|0402|0504|0603|0805|1206|1210|1812|2010|2512)(?:$|[_-])/i;
20311
+ var dimensionalSmdResistorPackagePattern = /^RES-SMD_L\d+(?:\.\d+)?-W\d+(?:\.\d+)?(?:$|[_-])/i;
20308
20312
  var normalizeExplicitScale = (scale2) => {
20309
20313
  if (scale2 === "k" || scale2 === "K") return "k";
20310
20314
  if (scale2 === "m") return "m";
@@ -20340,7 +20344,7 @@ var isResistorComponent = (betterEasy) => {
20340
20344
  const hasResistorCategory = betterEasy.tags.some(
20341
20345
  (tag) => /\bresistors?\b/i.test(tag)
20342
20346
  );
20343
- return (componentParameters.pre?.toUpperCase() === "R?" || hasResistorCategory) && typeof packageName === "string" && standardSmdResistorPackagePattern.test(packageName.trim()) && normalizeResistorValue(componentParameters.Value) !== void 0;
20347
+ return (componentParameters.pre?.toUpperCase() === "R?" || hasResistorCategory) && typeof packageName === "string" && (standardSmdResistorPackagePattern.test(packageName.trim()) || dimensionalSmdResistorPackagePattern.test(packageName.trim())) && normalizeResistorValue(componentParameters.Value) !== void 0;
20344
20348
  };
20345
20349
 
20346
20350
  // lib/websafe/convert-to-typescript-component/category-value-contains-switch.ts