@willcgage/module-schematic 0.67.0 → 0.69.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 +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -534,7 +534,7 @@ function endplateWidthFor(widths, id) {
|
|
|
534
534
|
return typeof w === "number" && w > 0 ? w : FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES;
|
|
535
535
|
}
|
|
536
536
|
function isLoopDoc(doc) {
|
|
537
|
-
return doc.loop === true
|
|
537
|
+
return doc.loop === true;
|
|
538
538
|
}
|
|
539
539
|
var MAIN_TRACK_ID = "main";
|
|
540
540
|
var MAIN2_TRACK_ID = "main2";
|
|
@@ -931,8 +931,14 @@ function docToState(doc, fallbackLength, moduleTracks = []) {
|
|
|
931
931
|
loopReturn: loop && d.loopReturn === "main2" ? "main2" : "same",
|
|
932
932
|
mainsSwapped: d.mainsSwapped === true,
|
|
933
933
|
configA: configOf("A"),
|
|
934
|
-
//
|
|
935
|
-
|
|
934
|
+
// NO ENDPLATE B ⇒ "none", whatever kind of module this is. On a loop that
|
|
935
|
+
// reads as a pure turnback (a present B makes it an interchange); on an end
|
|
936
|
+
// of the line or a pocket it simply means the module has one face (#184).
|
|
937
|
+
// ⚠️ This used to be `loop && !hasB`, so "none" only survived a round trip on
|
|
938
|
+
// a loop — which passed its test yesterday ONLY because a single-endplate
|
|
939
|
+
// module was still being misclassified as one (#191). The absence of the
|
|
940
|
+
// plate is the fact; why it's absent doesn't change what to read.
|
|
941
|
+
configB: hasB ? configOf("B") : "none",
|
|
936
942
|
branches: branchEps.map((ep) => ({
|
|
937
943
|
label: ep.label ?? "Branch",
|
|
938
944
|
pos: sc(ep.at.pos),
|
|
@@ -1864,6 +1870,7 @@ function moduleFeatures(doc) {
|
|
|
1864
1870
|
crossings,
|
|
1865
1871
|
crossovers,
|
|
1866
1872
|
branchConnectors,
|
|
1873
|
+
hasEndplateB: doc.endplates.some((e) => e.id === "B"),
|
|
1867
1874
|
industries,
|
|
1868
1875
|
laneMin: Math.min(...allLanes),
|
|
1869
1876
|
laneMax: Math.max(...allLanes)
|