@transportme/vline-nsp-reader 1.0.10 → 1.0.12

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.
@@ -49,7 +49,11 @@ export default class PassPDFReader {
49
49
  continue
50
50
  }
51
51
  if (!stopData || stopData.length === 1) continue
52
- if (stationName === 'Change Service' && !currentRun.stops.length) continue
52
+ if (stationName === 'Change Service' && !currentRun.stops.length) {
53
+ currentRun.type = stopData[0] + stopData.slice(1).toLowerCase()
54
+ continue
55
+ }
56
+
53
57
  if (stationName === 'Change Service' && stopData.length) {
54
58
  currentRun.stops.push(lastStation)
55
59
  runs.push(currentRun)
@@ -86,8 +86,10 @@ export default class PassTableReader {
86
86
  const colCount = tableData[1].length
87
87
  for (let x = colCount - 1; x > 0; x--) {
88
88
  let text = tableData[0][x] || ''
89
- if (text.startsWith(' ') || text.startsWith('to')) {
90
- tableData[0][x - 1] = (tableData[0][x - 1] + ' ' + text.trim()).replace('continued', '').trim()
89
+ if (text.trim().match(/^cont.+$/)) {
90
+ tableData[0][x] = ''
91
+ } else if (text.startsWith(' ') || text.startsWith('to')) {
92
+ tableData[0][x - 1] = (tableData[0][x - 1] + ' ' + text.trim()).replace(/cont.+/, '').trim()
91
93
  tableData[0][x] = ''
92
94
  }
93
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/vline-nsp-reader",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "main": "lib.mjs",
5
5
  "scripts": {
6
6
  "test": "mocha './{,!(node_modules)/**}/*.test.mjs'"