easyeda 0.0.286 → 0.0.287

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.
@@ -11864,11 +11864,12 @@ var getPortMetadataByShapeId = (easyEdaJson, circuitJson) => {
11864
11864
  const numericPinNumber = Number(pin.pinNumber);
11865
11865
  if (!portName && Number.isInteger(numericPinNumber)) {
11866
11866
  const numericPortName = `pin${numericPinNumber}`;
11867
- if (sourcePorts.some((port) => port.name === numericPortName)) {
11867
+ if (!usedPortNames.has(numericPortName) && sourcePorts.some((port) => port.name === numericPortName)) {
11868
11868
  portName = numericPortName;
11869
11869
  }
11870
11870
  }
11871
- portName ??= sourcePorts[pinIndex]?.name ?? `pin${pinIndex + 1}`;
11871
+ portName ??= sourcePorts.find((port) => !usedPortNames.has(port.name))?.name;
11872
+ portName ??= `pin${pinIndex + 1}`;
11872
11873
  usedPortNames.add(portName);
11873
11874
  const sourcePort = sourcePorts.find((port) => port.name === portName);
11874
11875
  metadataByShapeId.set(pin.id, {