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