easyeda 0.0.209 → 0.0.210

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.
@@ -3019,8 +3019,7 @@ expectStringUnionsMatch(true);
3019
3019
 
3020
3020
  // node_modules/@tscircuit/circuit-json-util/dist/index.js
3021
3021
  function connect(map, a, b) {
3022
- if (!a || !b)
3023
- return;
3022
+ if (!a || !b) return;
3024
3023
  let setA = map.get(a);
3025
3024
  if (!setA) {
3026
3025
  setA = /* @__PURE__ */ new Set();
@@ -3035,8 +3034,7 @@ function connect(map, a, b) {
3035
3034
  setB.add(a);
3036
3035
  }
3037
3036
  function buildSubtree(soup, opts) {
3038
- if (!opts.subcircuit_id && !opts.source_group_id)
3039
- return [...soup];
3037
+ if (!opts.subcircuit_id && !opts.source_group_id) return [...soup];
3040
3038
  const idMap = /* @__PURE__ */ new Map();
3041
3039
  for (const elm of soup) {
3042
3040
  const idVal = elm[`${elm.type}_id`];
@@ -3048,8 +3046,7 @@ function buildSubtree(soup, opts) {
3048
3046
  for (const elm of soup) {
3049
3047
  const entries = Object.entries(elm);
3050
3048
  for (const [key, val58] of entries) {
3051
- if (key === "parent_source_group_id")
3052
- continue;
3049
+ if (key === "parent_source_group_id") continue;
3053
3050
  if (key.endsWith("_id") && typeof val58 === "string") {
3054
3051
  const other = idMap.get(val58);
3055
3052
  connect(adj, elm, other);
@@ -3076,8 +3073,7 @@ function buildSubtree(soup, opts) {
3076
3073
  while (queue.length > 0) {
3077
3074
  const elm = queue.shift();
3078
3075
  const neighbors = adj.get(elm);
3079
- if (!neighbors)
3080
- continue;
3076
+ if (!neighbors) continue;
3081
3077
  for (const n of neighbors) {
3082
3078
  if (!included.has(n)) {
3083
3079
  included.add(n);
@@ -3099,8 +3095,7 @@ var cju = (circuitJsonInput, options = {}) => {
3099
3095
  for (const elm of circuitJson) {
3100
3096
  const type = elm.type;
3101
3097
  const idVal = elm[`${type}_id`];
3102
- if (!idVal)
3103
- continue;
3098
+ if (!idVal) continue;
3104
3099
  const idNum = Number.parseInt(idVal.split("_").pop());
3105
3100
  if (!Number.isNaN(idNum)) {
3106
3101
  internalStore.counts[type] = Math.max(
@@ -3144,8 +3139,7 @@ var cju = (circuitJsonInput, options = {}) => {
3144
3139
  const joiner = circuitJson.find(
3145
3140
  (e) => e.type === join_type && e[join_key] === using[join_key]
3146
3141
  );
3147
- if (!joiner)
3148
- return null;
3142
+ if (!joiner) return null;
3149
3143
  return circuitJson.find(
3150
3144
  (e) => e.type === component_type && e[`${component_type}_id`] === joiner[`${component_type}_id`]
3151
3145
  );
@@ -3183,8 +3177,7 @@ var cju = (circuitJsonInput, options = {}) => {
3183
3177
  const elm = circuitJson.find(
3184
3178
  (e) => e[`${component_type}_id`] === id
3185
3179
  );
3186
- if (!elm)
3187
- return;
3180
+ if (!elm) return;
3188
3181
  circuitJson.splice(circuitJson.indexOf(elm), 1);
3189
3182
  internalStore.editCount++;
3190
3183
  },
@@ -3192,8 +3185,7 @@ var cju = (circuitJsonInput, options = {}) => {
3192
3185
  const elm = circuitJson.find(
3193
3186
  (e) => e.type === component_type && e[`${component_type}_id`] === id
3194
3187
  );
3195
- if (!elm)
3196
- return null;
3188
+ if (!elm) return null;
3197
3189
  Object.assign(elm, newProps);
3198
3190
  internalStore.editCount++;
3199
3191
  return elm;
@@ -3208,15 +3200,12 @@ var cju = (circuitJsonInput, options = {}) => {
3208
3200
  const source_component = circuitJson.find(
3209
3201
  (e) => e.type === "source_component" && e.name === component_name
3210
3202
  );
3211
- if (!source_component)
3212
- return null;
3203
+ if (!source_component) return null;
3213
3204
  const source_port2 = circuitJson.find(
3214
3205
  (e) => e.type === "source_port" && e.source_component_id === source_component.source_component_id && (e.name === port_selector || (e.port_hints ?? []).includes(port_selector))
3215
3206
  );
3216
- if (!source_port2)
3217
- return null;
3218
- if (component_type === "source_port")
3219
- return source_port2;
3207
+ if (!source_port2) return null;
3208
+ if (component_type === "source_port") return source_port2;
3220
3209
  if (component_type === "pcb_port") {
3221
3210
  return circuitJson.find(
3222
3211
  (e) => e.type === "pcb_port" && e.source_port_id === source_port2.source_port_id
@@ -3252,8 +3241,7 @@ var cjuIndexed = (soup, options = {}) => {
3252
3241
  for (const elm of soup) {
3253
3242
  const type = elm.type;
3254
3243
  const idVal = elm[`${type}_id`];
3255
- if (!idVal)
3256
- continue;
3244
+ if (!idVal) continue;
3257
3245
  const idNum = Number.parseInt(idVal.split("_").pop() || "");
3258
3246
  if (!Number.isNaN(idNum)) {
3259
3247
  internalStore.counts[type] = Math.max(
@@ -3378,8 +3366,7 @@ var cjuIndexed = (soup, options = {}) => {
3378
3366
  if (relationMap) {
3379
3367
  const relatedElements = relationMap.get(using[join_key]) || [];
3380
3368
  const joiner2 = relatedElements.find((e) => e.type === join_type);
3381
- if (!joiner2)
3382
- return null;
3369
+ if (!joiner2) return null;
3383
3370
  const joinerId = joiner2[`${component_type}_id`];
3384
3371
  if (indexConfig.byId && internalStore.indexes.byId) {
3385
3372
  return internalStore.indexes.byId.get(
@@ -3400,8 +3387,7 @@ var cjuIndexed = (soup, options = {}) => {
3400
3387
  const joiner = soup.find(
3401
3388
  (e) => e.type === join_type && e[join_key] === using[join_key]
3402
3389
  );
3403
- if (!joiner)
3404
- return null;
3390
+ if (!joiner) return null;
3405
3391
  return soup.find(
3406
3392
  (e) => e.type === component_type && e[`${component_type}_id`] === joiner[`${component_type}_id`]
3407
3393
  ) || null;
@@ -3540,8 +3526,7 @@ var cjuIndexed = (soup, options = {}) => {
3540
3526
  } else {
3541
3527
  elm = soup.find((e) => e[`${component_type}_id`] === id);
3542
3528
  }
3543
- if (!elm)
3544
- return;
3529
+ if (!elm) return;
3545
3530
  const elmIndex = soup.indexOf(elm);
3546
3531
  if (elmIndex >= 0) {
3547
3532
  soup.splice(elmIndex, 1);
@@ -3618,8 +3603,7 @@ var cjuIndexed = (soup, options = {}) => {
3618
3603
  (e) => e.type === component_type && e[`${component_type}_id`] === id
3619
3604
  );
3620
3605
  }
3621
- if (!elm)
3622
- return null;
3606
+ if (!elm) return null;
3623
3607
  if (indexConfig.byRelation && internalStore.indexes.byRelation) {
3624
3608
  const elementEntries = Object.entries(elm);
3625
3609
  for (const [key, value] of elementEntries) {
@@ -3735,13 +3719,11 @@ var cjuIndexed = (soup, options = {}) => {
3735
3719
  const source_component = soup.find(
3736
3720
  (e) => e.type === "source_component" && e.name === component_name
3737
3721
  );
3738
- if (!source_component)
3739
- return null;
3722
+ if (!source_component) return null;
3740
3723
  const source_port2 = soup.find(
3741
3724
  (e) => e.type === "source_port" && e.source_component_id === source_component.source_component_id && (e.name === port_selector || (e.port_hints ?? []).includes(port_selector))
3742
3725
  );
3743
- if (!source_port2)
3744
- return null;
3726
+ if (!source_port2) return null;
3745
3727
  if (component_type === "source_port")
3746
3728
  return source_port2;
3747
3729
  if (component_type === "pcb_port") {
@@ -3837,16 +3819,13 @@ function getReadableNameForPcbTrace(soup, pcb_trace_id) {
3837
3819
  }
3838
3820
  function getComponentAndPortInfo(pcb_port_id) {
3839
3821
  const pcbPort = cju(soup).pcb_port.get(pcb_port_id);
3840
- if (!pcbPort)
3841
- return null;
3822
+ if (!pcbPort) return null;
3842
3823
  const pcbComponent = cju(soup).pcb_component.get(pcbPort.pcb_component_id);
3843
- if (!pcbComponent)
3844
- return null;
3824
+ if (!pcbComponent) return null;
3845
3825
  const sourceComponent = cju(soup).source_component.get(
3846
3826
  pcbComponent.source_component_id
3847
3827
  );
3848
- if (!sourceComponent)
3849
- return null;
3828
+ if (!sourceComponent) return null;
3850
3829
  const sourcePort = cju(soup).source_port.get(pcbPort.source_port_id);
3851
3830
  const portHint = sourcePort?.port_hints ? sourcePort.port_hints[1] : "";
3852
3831
  return {
@@ -3902,8 +3881,7 @@ function getReadableNameForPcbSmtpad(soup, pcb_smtpad_id) {
3902
3881
  var getReadableNameForElement = (soup, elm) => {
3903
3882
  if (typeof elm === "string") {
3904
3883
  const elmObj = getElementById(soup, elm);
3905
- if (!elmObj)
3906
- `unknown (could not find element with id ${elm})`;
3884
+ if (!elmObj) `unknown (could not find element with id ${elm})`;
3907
3885
  return getReadableNameForElement(soup, elmObj);
3908
3886
  }
3909
3887
  switch (elm.type) {
@@ -3925,8 +3903,7 @@ var getBoundsOfPcbElements = (elements) => {
3925
3903
  let maxX = Number.NEGATIVE_INFINITY;
3926
3904
  let maxY = Number.NEGATIVE_INFINITY;
3927
3905
  for (const elm of elements) {
3928
- if (!elm.type.startsWith("pcb_"))
3929
- continue;
3906
+ if (!elm.type.startsWith("pcb_")) continue;
3930
3907
  let centerX;
3931
3908
  let centerY;
3932
3909
  let width;
@@ -3979,8 +3956,7 @@ var getBoundsOfPcbElements = (elements) => {
3979
3956
  };
3980
3957
  function stringHash(str) {
3981
3958
  let hash = 0;
3982
- if (str.length == 0)
3983
- return hash;
3959
+ if (str.length == 0) return hash;
3984
3960
  for (var i = 0; i < str.length; i++) {
3985
3961
  var char = str.charCodeAt(i);
3986
3962
  hash = (hash << 5) - hash + char;
@@ -4122,8 +4098,7 @@ var getDebugLayoutObject = (lo) => {
4122
4098
  }
4123
4099
  const title = lo.text || lo.name || lo.source?.text || lo.source?.name || "?";
4124
4100
  const content = lo;
4125
- if (x === void 0 || y === void 0)
4126
- return null;
4101
+ if (x === void 0 || y === void 0) return null;
4127
4102
  if (width === void 0) {
4128
4103
  if ("outer_diameter" in lo) {
4129
4104
  width = lo.outer_diameter;
@@ -26252,4 +26227,4 @@ svgson/dist/svgson.umd.js:
26252
26227
  * @license MIT
26253
26228
  *)
26254
26229
  */
26255
- //# sourceMappingURL=chunk-HFO42OMI.js.map
26230
+ //# sourceMappingURL=chunk-OTDH63JU.js.map