bus-mj 2.2.7 → 2.2.8
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/package.json +1 -1
- package/src/getBus.js +3 -6
package/package.json
CHANGED
package/src/getBus.js
CHANGED
|
@@ -86,7 +86,7 @@ export function __findBusByStopLabel(stop_label, relations, beginLabel) {
|
|
|
86
86
|
(m) => m.label?.toUpperCase() === beginLabel.toUpperCase()
|
|
87
87
|
);
|
|
88
88
|
|
|
89
|
-
const endIndex = rel.members.
|
|
89
|
+
const endIndex = rel.members.findLastIndex(
|
|
90
90
|
(m) => m.label?.toUpperCase() === stop_label.toUpperCase()
|
|
91
91
|
);
|
|
92
92
|
|
|
@@ -94,15 +94,12 @@ export function __findBusByStopLabel(stop_label, relations, beginLabel) {
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
const start = Math.min(beginIndex, endIndex);
|
|
98
|
-
const end = Math.max(beginIndex, endIndex);
|
|
99
|
-
|
|
100
97
|
return {
|
|
101
98
|
...rel,
|
|
102
|
-
members: rel.members.slice(
|
|
99
|
+
members: rel.members.slice(beginIndex, endIndex + 1),
|
|
103
100
|
};
|
|
104
101
|
})
|
|
105
|
-
.filter(
|
|
102
|
+
.filter((bus) => bus !== null && bus.members.length > 0);
|
|
106
103
|
}
|
|
107
104
|
|
|
108
105
|
/**
|