bus-mj 2.2.7 → 2.2.9

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 CHANGED
@@ -890,13 +890,14 @@ export default [
890
890
  "id": 11030137461,
891
891
  "lat": -15.706799,
892
892
  "lon": 46.3207464,
893
- "label": "Tsaramandroso Shoprite"
893
+ "label": "makiloc"
894
894
  },
895
895
  {
896
896
  "type": "node",
897
897
  "id": 11027750481,
898
898
  "lat": -15.711999,
899
- "lon": 46.3190055
899
+ "lon": 46.3190055,
900
+ "label": "5 etage"
900
901
  },
901
902
  {
902
903
  "type": "node",
@@ -1182,7 +1183,7 @@ export default [
1182
1183
  "id": 11032158398,
1183
1184
  "lat": -15.6947721,
1184
1185
  "lon": 46.3278376,
1185
- "label": "HASIMA"
1186
+ "label": "HASYMA"
1186
1187
  },
1187
1188
  {
1188
1189
  "type": "node",
@@ -1278,7 +1279,7 @@ export default [
1278
1279
  "id": 1316377069,
1279
1280
  "lat": -15.6950635,
1280
1281
  "lon": 46.3276012,
1281
- "label": "HASIMA"
1282
+ "label": "HASYMA"
1282
1283
  },
1283
1284
  {
1284
1285
  "type": "node",
@@ -1313,7 +1314,7 @@ export default [
1313
1314
  "id": 11032129669,
1314
1315
  "lat": -15.6834718,
1315
1316
  "lon": 46.3345319,
1316
- "label": "Labatoto"
1317
+ "label": "Rabatoto"
1317
1318
  },
1318
1319
  {
1319
1320
  "type": "node",
@@ -2289,5 +2290,20 @@ export default [
2289
2290
  "lat": -15.71856,
2290
2291
  "lon": 46.3171984,
2291
2292
  "label": "Parkage régional"
2293
+ },
2294
+ {
2295
+ "type": "node",
2296
+ "id": 11035236076,
2297
+ "lat": -15.69764,
2298
+ "lon": 46.32568,
2299
+ "label": "Classico"
2300
+ },
2301
+ ,
2302
+ {
2303
+ "type": "node",
2304
+ "id": 11035236078,
2305
+ "lat": -15.69585,
2306
+ "lon": 46.32702,
2307
+ "label": "Vavahady"
2292
2308
  }
2293
- ];
2309
+ ];
package/data/relations.js CHANGED
@@ -1489,6 +1489,16 @@ export default [
1489
1489
  ref: 11032158398,
1490
1490
  role: "stop",
1491
1491
  },
1492
+ {
1493
+ type: "node",
1494
+ ref: 11035236076,
1495
+ role: "stop",
1496
+ },
1497
+ {
1498
+ type: "node",
1499
+ ref: 11035236078,
1500
+ role: "stop",
1501
+ },
1492
1502
  {
1493
1503
  type: "node",
1494
1504
  ref: 11032150436,
@@ -1519,6 +1529,11 @@ export default [
1519
1529
  ref: 11027750481,
1520
1530
  role: "stop",
1521
1531
  },
1532
+ {
1533
+ type: "node",
1534
+ ref: 11029976199,
1535
+ role: "stop",
1536
+ },
1522
1537
  {
1523
1538
  type: "node",
1524
1539
  ref: 11029976200,
@@ -1616,7 +1631,7 @@ export default [
1616
1631
  board: null,
1617
1632
  fee: "yes",
1618
1633
  from: "Mangatokana",
1619
- name: "Ligne 8 Mangatokana- Ankaraobato",
1634
+ name: "Ligne 8 Mangatokana - Ankaraobato",
1620
1635
  network: "zone urbain",
1621
1636
  opening_hours: "Mo-Su 05:00-20:00",
1622
1637
  operator: "MAHATSINJO",
@@ -1868,6 +1883,16 @@ export default [
1868
1883
  ref: 11032158398,
1869
1884
  role: "stop",
1870
1885
  },
1886
+ {
1887
+ type: "node",
1888
+ ref: 11035236076,
1889
+ role: "stop",
1890
+ },
1891
+ {
1892
+ type: "node",
1893
+ ref: 11035236078,
1894
+ role: "stop",
1895
+ },
1871
1896
  {
1872
1897
  type: "node",
1873
1898
  ref: 11032150436,
@@ -1950,14 +1975,14 @@ export default [
1950
1975
  board: null,
1951
1976
  fee: "yes",
1952
1977
  from: "Port",
1953
- name: "Ligne 6 Port-Pamba Amborovy",
1978
+ name: "Ligne 6 Port - Pamba Amborovy",
1954
1979
  network: "zone urbain",
1955
1980
  opening_hours: "Mo-Su 05:00-19:00",
1956
1981
  operator: "TAMBATRA",
1957
1982
  "public_transport:version": "2",
1958
1983
  ref: "6",
1959
1984
  route: "bus",
1960
- to: "Pamba",
1985
+ to: "Pamba Amborovy",
1961
1986
  type: "route",
1962
1987
  },
1963
1988
  },
@@ -2818,6 +2843,16 @@ export default [
2818
2843
  ref: 11032158398,
2819
2844
  role: "stop",
2820
2845
  },
2846
+ {
2847
+ type: "node",
2848
+ ref: 11035236076,
2849
+ role: "stop",
2850
+ },
2851
+ {
2852
+ type: "node",
2853
+ ref: 11035236078,
2854
+ role: "stop",
2855
+ },
2821
2856
  {
2822
2857
  type: "node",
2823
2858
  ref: 11032150436,
@@ -2870,7 +2905,7 @@ export default [
2870
2905
  board: null,
2871
2906
  fee: "yes",
2872
2907
  from: "Aranta",
2873
- name: "Ligne 12 Aranta-CDA Aqualma",
2908
+ name: "Ligne 12 Aranta - CDA Aqualma",
2874
2909
  network: "zone urbain",
2875
2910
  opening_hours: "Mo-Su 05:00-19:00",
2876
2911
  operator: "MAHATSINJO",
@@ -3987,6 +4022,16 @@ export default [
3987
4022
  ref: 11032158398,
3988
4023
  role: "stop",
3989
4024
  },
4025
+ {
4026
+ type: "node",
4027
+ ref: 11035236076,
4028
+ role: "stop",
4029
+ },
4030
+ {
4031
+ type: "node",
4032
+ ref: 11035236078,
4033
+ role: "stop",
4034
+ },
3990
4035
  {
3991
4036
  type: "node",
3992
4037
  ref: 11032150436,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bus-mj",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "package for BUS station in Mahajanga",
5
5
  "type": "module",
6
6
  "main": "index.js",
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.findIndex(
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(start, end + 1),
99
+ members: rel.members.slice(beginIndex, endIndex + 1),
103
100
  };
104
101
  })
105
- .filter(Boolean);
102
+ .filter((bus) => bus !== null && bus.members.length > 0);
106
103
  }
107
104
 
108
105
  /**