mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
remove (arrival|departure).trip, movement.trip 💥
This commit is contained in:
parent
fcc2a23fc1
commit
9c449958c4
3 changed files with 1 additions and 5 deletions
|
@ -23,9 +23,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
|
||||||
// todo: for arrivals, this is the *origin*, not the *direction*
|
// todo: for arrivals, this is the *origin*, not the *direction*
|
||||||
direction: prefix === DEPARTURE && profile.parseStationName(d.dirTxt) || null,
|
direction: prefix === DEPARTURE && profile.parseStationName(d.dirTxt) || null,
|
||||||
line: lines[parseInt(d.prodX)] || null,
|
line: lines[parseInt(d.prodX)] || null,
|
||||||
remarks: [],
|
remarks: []
|
||||||
// todo: res.trip from rawLine.prodCtx.num?
|
|
||||||
trip: +d.jid.split('|')[1] // todo: this seems brittle
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: DRY with parseStopover
|
// todo: DRY with parseStopover
|
||||||
|
|
|
@ -15,7 +15,6 @@ const createParseMovement = (profile, opt, data) => {
|
||||||
const res = {
|
const res = {
|
||||||
direction: profile.parseStationName(m.dirTxt),
|
direction: profile.parseStationName(m.dirTxt),
|
||||||
tripId: m.jid || null,
|
tripId: m.jid || null,
|
||||||
trip: m.jid && +m.jid.split('|')[1] || null, // todo: this seems brittle
|
|
||||||
line: lines[m.prodX] || null,
|
line: lines[m.prodX] || null,
|
||||||
location: m.pos ? {
|
location: m.pos ? {
|
||||||
type: 'location',
|
type: 'location',
|
||||||
|
|
|
@ -331,7 +331,6 @@ const createValidateArrivalOrDeparture = (type, cfg) => {
|
||||||
|
|
||||||
a.strictEqual(typeof dep.tripId, 'string', name + '.tripId must be a string')
|
a.strictEqual(typeof dep.tripId, 'string', name + '.tripId must be a string')
|
||||||
a.ok(dep.tripId, name + '.tripId must not be empty')
|
a.ok(dep.tripId, name + '.tripId must not be empty')
|
||||||
a.strictEqual(typeof dep.trip, 'number', name + '.trip must be a number')
|
|
||||||
|
|
||||||
anyOf(['stop', 'station'], val, dep.stop, name + '.stop')
|
anyOf(['stop', 'station'], val, dep.stop, name + '.stop')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue