bus-mj 2.2.0 → 2.2.1
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 +12 -1
package/package.json
CHANGED
package/src/getBus.js
CHANGED
|
@@ -25,7 +25,18 @@ export function findStopByRef(ref) {
|
|
|
25
25
|
* @returns { Stop[] }
|
|
26
26
|
*/
|
|
27
27
|
export function findStopAll() {
|
|
28
|
-
|
|
28
|
+
const seen = new Set();
|
|
29
|
+
|
|
30
|
+
return nodes.filter((node) => {
|
|
31
|
+
if (!node.label) return false;
|
|
32
|
+
|
|
33
|
+
if (seen.has(node.label)) {
|
|
34
|
+
return false; // already see → pass
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
seen.add(node.label);
|
|
38
|
+
return true; // first found → keep
|
|
39
|
+
});
|
|
29
40
|
}
|
|
30
41
|
|
|
31
42
|
/**
|