@willcgage/module-schematic 0.42.0 → 0.44.0

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
@@ -1143,6 +1143,7 @@ function moduleFeatures(doc) {
1143
1143
  const extraTracks = [];
1144
1144
  for (const t of doc.tracks) {
1145
1145
  if (t.role === "main") continue;
1146
+ if (t.role === "branch") continue;
1146
1147
  if (isCrossover(t.id)) continue;
1147
1148
  const ext = extentOf(t);
1148
1149
  if (!ext) continue;
@@ -1239,7 +1240,9 @@ function moduleFeatures(doc) {
1239
1240
  laneA: trackLane.get(x.tracks?.[0] ?? "") ?? 0,
1240
1241
  laneB: trackLane.get(x.tracks?.[1] ?? "") ?? 1
1241
1242
  }));
1242
- const branchConnectors = doc.endplates.filter((e) => e.id !== "A" && e.id !== "B" && e.at).map((e) => ({
1243
+ const branchConnectors = doc.endplates.filter(
1244
+ (e) => e.id !== "A" && e.id !== "B" && e.at && !!e.trackId && (doc.tracks ?? []).some((t) => t.id === e.trackId)
1245
+ ).map((e) => ({
1243
1246
  id: e.id,
1244
1247
  label: e.label ?? e.id,
1245
1248
  posFrac: clampFrac(e.at.pos),