mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
movement.nextStops -> movement.nextStopovers 💥
This commit is contained in:
parent
59584a3402
commit
bbff1f4c63
6 changed files with 11 additions and 11 deletions
|
@ -68,7 +68,7 @@ The response may look like this:
|
||||||
},
|
},
|
||||||
direction: 'S Flughafen Berlin-Schönefeld',
|
direction: 'S Flughafen Berlin-Schönefeld',
|
||||||
trip: 31463,
|
trip: 31463,
|
||||||
nextStops: [ {
|
nextStopovers: [ {
|
||||||
stop: {
|
stop: {
|
||||||
type: 'stop',
|
type: 'stop',
|
||||||
id: '900000029101',
|
id: '900000029101',
|
||||||
|
@ -141,7 +141,7 @@ The response may look like this:
|
||||||
},
|
},
|
||||||
direction: 'Heinersdorf',
|
direction: 'Heinersdorf',
|
||||||
trip: 26321,
|
trip: 26321,
|
||||||
nextStops: [ {
|
nextStopovers: [ {
|
||||||
stop: { /* S+U Alexanderplatz/Dircksenstr. */ },
|
stop: { /* S+U Alexanderplatz/Dircksenstr. */ },
|
||||||
arrival: null,
|
arrival: null,
|
||||||
arrivalDelay: null,
|
arrivalDelay: null,
|
||||||
|
|
|
@ -82,8 +82,8 @@ const createParseMovement = (profile, opt, data) => {
|
||||||
const _parseMovement = _createParseMovement(profile, opt, data)
|
const _parseMovement = _createParseMovement(profile, opt, data)
|
||||||
const parseMovement = (m) => {
|
const parseMovement = (m) => {
|
||||||
const res = _parseMovement(m)
|
const res = _parseMovement(m)
|
||||||
// filter out empty nextStops entries
|
// filter out empty nextStopovers entries
|
||||||
res.nextStops = res.nextStops.filter((f) => {
|
res.nextStopovers = res.nextStopovers.filter((f) => {
|
||||||
return f.stop !== null || f.arrival !== null || f.departure !== null
|
return f.stop !== null || f.arrival !== null || f.departure !== null
|
||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -50,7 +50,7 @@ const createParseMovement = (profile, opt, data) => {
|
||||||
const res = _parseMovement(m)
|
const res = _parseMovement(m)
|
||||||
// filter out POIs
|
// filter out POIs
|
||||||
// todo: make use of them, as some of them specify fare zones
|
// todo: make use of them, as some of them specify fare zones
|
||||||
res.nextStops = res.nextStops.filter(st => {
|
res.nextStopovers = res.nextStopovers.filter(st => {
|
||||||
const s = st.stop || {}
|
const s = st.stop || {}
|
||||||
if (s.station) {
|
if (s.station) {
|
||||||
s = s.station
|
s = s.station
|
||||||
|
|
|
@ -23,7 +23,7 @@ const createParseMovement = (profile, opt, data) => {
|
||||||
const parseMovement = (m) => {
|
const parseMovement = (m) => {
|
||||||
const res = _parseMovement(m)
|
const res = _parseMovement(m)
|
||||||
// filter out empty stopovers
|
// filter out empty stopovers
|
||||||
res.nextStops = res.nextStops.filter(st => !!st.stop)
|
res.nextStopovers = res.nextStopovers.filter(st => !!st.stop)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
return parseMovement
|
return parseMovement
|
||||||
|
|
|
@ -22,7 +22,7 @@ const createParseMovement = (profile, opt, data) => {
|
||||||
latitude: m.pos.y / 1000000,
|
latitude: m.pos.y / 1000000,
|
||||||
longitude: m.pos.x / 1000000
|
longitude: m.pos.x / 1000000
|
||||||
} : null,
|
} : null,
|
||||||
nextStops: m.stopL.map(pStopover),
|
nextStopovers: m.stopL.map(pStopover),
|
||||||
frames: []
|
frames: []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -403,10 +403,10 @@ const createValidateMovement = (cfg) => {
|
||||||
a.ok(m.location.longitude >= minLongitude, lName + '.longitude is too small')
|
a.ok(m.location.longitude >= minLongitude, lName + '.longitude is too small')
|
||||||
}
|
}
|
||||||
|
|
||||||
a.ok(Array.isArray(m.nextStops), name + '.nextStops must be an array')
|
a.ok(Array.isArray(m.nextStopovers), name + '.nextStopovers must be an array')
|
||||||
for (let i = 0; i < m.nextStops.length; i++) {
|
for (let i = 0; i < m.nextStopovers.length; i++) {
|
||||||
const st = m.nextStops[i]
|
const st = m.nextStopovers[i]
|
||||||
val.stopover(val, st, name + `.nextStops[${i}]`)
|
val.stopover(val, st, name + `.nextStopovers[${i}]`)
|
||||||
}
|
}
|
||||||
|
|
||||||
a.ok(Array.isArray(m.frames), name + '.frames must be an array')
|
a.ok(Array.isArray(m.frames), name + '.frames must be an array')
|
||||||
|
|
Loading…
Add table
Reference in a new issue