altium-to-circuit-json 0.0.44 → 0.0.46

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
@@ -600,6 +600,7 @@ function convertAltiumPcbDocToCircuitJson(document, options = {}) {
600
600
  }
601
601
  if (isOverlayLayer(record.layer)) {
602
602
  if (options.includeSilkscreen === false) continue;
603
+ if (isHiddenComponentText(document, record)) continue;
603
604
  const text = convertSilkscreenText(record, index);
604
605
  if (text) elements.push(text);
605
606
  } else {
@@ -1304,6 +1305,11 @@ function convertSilkscreenText(record, index) {
1304
1305
  is_mirrored: record.mirrored
1305
1306
  };
1306
1307
  }
1308
+ function isHiddenComponentText(document, record) {
1309
+ const component = document.getComponentForRecord(record);
1310
+ if (!component) return false;
1311
+ return record.getBoolean("DESIGNATOR") === true && component.getBoolean("NAMEON") === false || record.getBoolean("COMMENT") === true && component.getBoolean("COMMENTON") === false;
1312
+ }
1307
1313
  function convertMechanicalText({
1308
1314
  document,
1309
1315
  record,