@transportme/vline-nsp-reader 1.0.8 → 1.0.10
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.
|
@@ -10,7 +10,7 @@ export default class PassPDFReader {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
getStations(table) {
|
|
13
|
-
return table.map(row => row[0].replace(/a ?r ?r$/, '').replace(/d ?e ?p$/, '').trim())
|
|
13
|
+
return table.map(row => row[0].replace(/a ?r ?r$/, '').replace(/d ?e ?p$/, '').replace(/ +[ad]$/, '').trim())
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
getBody(table) {
|
|
@@ -41,7 +41,7 @@ export default class PassPDFReader {
|
|
|
41
41
|
const stationName = stations[stationIndex]
|
|
42
42
|
const stopData = (body[stationIndex][columnIndex] || '').replace('.', ':')
|
|
43
43
|
if (stationName === 'Service') {
|
|
44
|
-
currentRun.type = stopData[0] + stopData.slice(1).toLowerCase()
|
|
44
|
+
currentRun.type = stopData[0] ? stopData[0] + stopData.slice(1).toLowerCase() : null
|
|
45
45
|
continue
|
|
46
46
|
}
|
|
47
47
|
if (stationName === 'Service Information') {
|
|
@@ -81,7 +81,7 @@ export default class PassPDFReader {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
return runs.map(run => this.setRunData(run))
|
|
84
|
+
return runs.filter(run => run.type).map(run => this.setRunData(run))
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
setRunData(run) {
|