bus-mj 2.2.2 → 2.2.4
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/data/nodes.js +8 -8
- package/data/relations.js +5 -25
- package/package.json +1 -1
- package/src/getBus.js +13 -9
package/data/nodes.js
CHANGED
|
@@ -170,7 +170,7 @@ export default [
|
|
|
170
170
|
"id": 11031963685,
|
|
171
171
|
"lat": -15.7173625,
|
|
172
172
|
"lon": 46.3225145,
|
|
173
|
-
"label": "
|
|
173
|
+
"label": "Bain douche"
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
"type": "node",
|
|
@@ -280,7 +280,7 @@ export default [
|
|
|
280
280
|
"id": 11029704990,
|
|
281
281
|
"lat": -15.7072161,
|
|
282
282
|
"lon": 46.3124853,
|
|
283
|
-
"label": "
|
|
283
|
+
"label": "Bar Sofa"
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
286
|
"type": "node",
|
|
@@ -459,7 +459,7 @@ export default [
|
|
|
459
459
|
"id": 11027750437,
|
|
460
460
|
"lat": -15.7184238,
|
|
461
461
|
"lon": 46.3166675,
|
|
462
|
-
"label": "
|
|
462
|
+
"label": "Hôtel de Ville"
|
|
463
463
|
},
|
|
464
464
|
{
|
|
465
465
|
"type": "node",
|
|
@@ -695,7 +695,7 @@ export default [
|
|
|
695
695
|
"id": 11029976164,
|
|
696
696
|
"lat": -15.723803,
|
|
697
697
|
"lon": 46.3106776,
|
|
698
|
-
"label": "
|
|
698
|
+
"label": "Bazary Be"
|
|
699
699
|
},
|
|
700
700
|
{
|
|
701
701
|
"type": "node",
|
|
@@ -1029,7 +1029,7 @@ export default [
|
|
|
1029
1029
|
"id": 11032282188,
|
|
1030
1030
|
"lat": -15.7184704,
|
|
1031
1031
|
"lon": 46.3171848,
|
|
1032
|
-
"label": "
|
|
1032
|
+
"label": "Hôtel de Ville"
|
|
1033
1033
|
},
|
|
1034
1034
|
{
|
|
1035
1035
|
"type": "node",
|
|
@@ -1375,7 +1375,7 @@ export default [
|
|
|
1375
1375
|
"id": 11029976154,
|
|
1376
1376
|
"lat": -15.7186046,
|
|
1377
1377
|
"lon": 46.3164436,
|
|
1378
|
-
"label": "
|
|
1378
|
+
"label": "Hôtel de Ville"
|
|
1379
1379
|
},
|
|
1380
1380
|
{
|
|
1381
1381
|
"type": "node",
|
|
@@ -1845,7 +1845,7 @@ export default [
|
|
|
1845
1845
|
"id": 11033858714,
|
|
1846
1846
|
"lat": -15.7169456,
|
|
1847
1847
|
"lon": 46.3171033,
|
|
1848
|
-
"label": "
|
|
1848
|
+
"label": "Hôtel de Ville"
|
|
1849
1849
|
},
|
|
1850
1850
|
{
|
|
1851
1851
|
"type": "node",
|
|
@@ -1880,7 +1880,7 @@ export default [
|
|
|
1880
1880
|
"id": 11027750433,
|
|
1881
1881
|
"lat": -15.7238554,
|
|
1882
1882
|
"lon": 46.3105541,
|
|
1883
|
-
"label": "
|
|
1883
|
+
"label": "Bazary Be"
|
|
1884
1884
|
},
|
|
1885
1885
|
{
|
|
1886
1886
|
"type": "node",
|
package/data/relations.js
CHANGED
|
@@ -130,22 +130,7 @@ export default [
|
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
type: "node",
|
|
133
|
-
ref:
|
|
134
|
-
role: "stop",
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
type: "node",
|
|
138
|
-
ref: 11029740920,
|
|
139
|
-
role: "stop",
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
type: "node",
|
|
143
|
-
ref: 11029976152,
|
|
144
|
-
role: "stop",
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
type: "node",
|
|
148
|
-
ref: 11027750439,
|
|
133
|
+
ref: 11029976201,
|
|
149
134
|
role: "stop",
|
|
150
135
|
},
|
|
151
136
|
{
|
|
@@ -495,7 +480,7 @@ export default [
|
|
|
495
480
|
board: "red",
|
|
496
481
|
fee: "yes",
|
|
497
482
|
from: "Belobaka",
|
|
498
|
-
name: "Ligne 7 Plaque
|
|
483
|
+
name: "Ligne 7 Plaque Manga",
|
|
499
484
|
network: "Zone Urbaine",
|
|
500
485
|
opening_hours: "Mo-Su 04:00-22:00",
|
|
501
486
|
operator: "MAMI",
|
|
@@ -637,17 +622,12 @@ export default [
|
|
|
637
622
|
},
|
|
638
623
|
{
|
|
639
624
|
type: "node",
|
|
640
|
-
ref:
|
|
641
|
-
role: "stop",
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
type: "node",
|
|
645
|
-
ref: 11029740920,
|
|
625
|
+
ref: 11027750439,
|
|
646
626
|
role: "stop",
|
|
647
627
|
},
|
|
648
628
|
{
|
|
649
629
|
type: "node",
|
|
650
|
-
ref:
|
|
630
|
+
ref: 11027750437,
|
|
651
631
|
role: "stop",
|
|
652
632
|
},
|
|
653
633
|
{
|
|
@@ -987,7 +967,7 @@ export default [
|
|
|
987
967
|
board: "blue",
|
|
988
968
|
fee: "yes",
|
|
989
969
|
from: "Belobaka",
|
|
990
|
-
name: "Ligne 7 Plaque
|
|
970
|
+
name: "Ligne 7 Plaque Mena",
|
|
991
971
|
network: "Zone Urbaine",
|
|
992
972
|
opening_hours: "Mo-Su 04:00-22:00",
|
|
993
973
|
operator: "MAMI",
|
package/package.json
CHANGED
package/src/getBus.js
CHANGED
|
@@ -70,6 +70,18 @@ export function findBusByStopLabel(stop_label) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* find Bus that have a one stop asked
|
|
75
|
+
* @param {string} stop_label label of stop
|
|
76
|
+
* @param {Bus[]} __relation list of bus to filter
|
|
77
|
+
* @returns { Bus[] }
|
|
78
|
+
*/
|
|
79
|
+
export function __findBusByStopLabel(stop_label, __relation) {
|
|
80
|
+
return __relation.filter((rel) => {
|
|
81
|
+
return rel.members.some((member) => member.label && member.label.toUpperCase() == stop_label.toUpperCase());
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
73
85
|
/**
|
|
74
86
|
* find the right bus of trajet giving
|
|
75
87
|
* @param {number} begin STOP_ID - begin of Road
|
|
@@ -91,15 +103,7 @@ export function findBusByTwoStop(begin, end) {
|
|
|
91
103
|
*/
|
|
92
104
|
export function findBusByTwoStopLabel(begin, end) {
|
|
93
105
|
let firstRelationsFound = findBusByStopLabel(begin);
|
|
94
|
-
return firstRelationsFound
|
|
95
|
-
const beginIndex = relation.members.findIndex(
|
|
96
|
-
(member) => member.label && member.label.toUpperCase() == begin.toUpperCase()
|
|
97
|
-
);
|
|
98
|
-
const endIndex = relation.members.findIndex(
|
|
99
|
-
(member) => member.label && member.label.toUpperCase() == end.toUpperCase()
|
|
100
|
-
);
|
|
101
|
-
return beginIndex != -1 && endIndex != -1 && beginIndex < endIndex;
|
|
102
|
-
});
|
|
106
|
+
return __findBusByStopLabel(end, firstRelationsFound);
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
/**
|