Skip to content

Commit

Permalink
logging for null line & "S" line
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Dec 6, 2017
1 parent 6bf3531 commit 43355d7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ modesByClass[64] = modes[6]

const line = (p) => {
const r = parse.line(p)
if (!r) return null
if (!r) {
debug('null line', p, r)
return null
}
if (r.productCode) {
r.productCode = parseInt(r.productCode)
r.product = (util.products.categories[r.productCode] || {}).type || null
Expand Down Expand Up @@ -90,7 +93,18 @@ const journey = (l, p, r) => {
}
}
}
return parseJourney(j)

// derhuerst/vbb-gtfs#2
const parsed = parseJourney(j)
if (parsed && Array.isArray(parsed.parts)) {
for (let part of parsed.parts) {
if (part && part.line && part.line.name === 'S') {
debug('S line', part)
}
}
}

return parsed
}
return tapped
}
Expand Down

0 comments on commit 43355d7

Please sign in to comment.