@transportme/vline-nsp-reader 1.0.1 → 1.0.2

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.
@@ -1,5 +1,6 @@
1
1
  import { getOperationDays } from './nsp-utils.mjs'
2
2
  import TableReader from './table-reader.mjs'
3
+ import termini from './termini.mjs'
3
4
 
4
5
  export default class NSPPDFReader {
5
6
 
@@ -138,6 +139,12 @@ export default class NSPPDFReader {
138
139
  runData.stations = runData.stations.map(station => this.processStation(station))
139
140
  let forming = body[stations.length - 1][runIndex].toUpperCase()
140
141
  runData.forming = forming.length ? forming : null
142
+
143
+ let origin = runData.stations[0].name.toUpperCase()
144
+ let destination = runData.stations[runData.stations.length - 1].name.toUpperCase()
145
+
146
+ runData.routeName = termini[`${origin}-${destination}`] || termini[origin] || termini[destination] || 'Other'
147
+
141
148
  runs.push(runData)
142
149
  }
143
150
 
@@ -0,0 +1,43 @@
1
+ export default {
2
+ ALBURY: 'Albury',
3
+ WODONGA: 'Albury',
4
+ WANGARATTA: 'Albury',
5
+
6
+ ARARAT: 'Ararat',
7
+
8
+ BAIRNSDALE: 'Bairnsdale',
9
+ SALE: 'Bairnsdale',
10
+
11
+ BENDIGO: 'Bendigo',
12
+ CASTLEMAINE: 'Bendigo',
13
+ EAGLEHAWK: 'Bendigo',
14
+ EPSOM: 'Bendigo',
15
+ KYNETON: 'Bendigo',
16
+
17
+ 'BACCHUS MARSH': 'Ballarat',
18
+ BALLARAT: 'Ballarat',
19
+ WENDOUREE: 'Ballarat',
20
+ MELTON: 'Ballarat',
21
+
22
+ ECHUCA: 'Echuca',
23
+
24
+ GEELONG: 'Geelong',
25
+ MARSHALL: 'Geelong',
26
+ 'SOUTH GEELONG': 'Geelong',
27
+ 'WAURN PONDS': 'Geelong',
28
+ 'WYNDHAM VALE': 'Geelong',
29
+
30
+ MARYBOROUGH: 'Maryborough',
31
+ 'MARYBOROUGH-BALLARAT': 'Maryborough',
32
+ 'BALLARAT-MARYBOROUGH': 'Maryborough',
33
+
34
+ SEYMOUR: 'Seymour',
35
+ SHEPPARTON: 'Shepparton',
36
+
37
+ 'SWAN HILL': 'Swan Hill',
38
+ 'SWAN HILL-BENDIGO': 'Swan Hill',
39
+
40
+ TRARALGON: 'Traralgon',
41
+
42
+ WARRNAMBOOL: 'Warrnambool'
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/vline-nsp-reader",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "lib.mjs",
5
5
  "scripts": {
6
6
  "test": "mocha"