mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
parse fn signatures: bugfixes 🐛
This commit is contained in:
parent
4c86b625c7
commit
b02f012b18
2 changed files with 4 additions and 3 deletions
3
index.js
3
index.js
|
@ -234,6 +234,7 @@ const createClient = (profile, request = _request) => {
|
|||
else if ('string' === typeof station) station = profile.formatStation(station)
|
||||
else throw new Error('station must be an object or a string.')
|
||||
|
||||
const opt = {}
|
||||
return request(profile, opt, {
|
||||
meth: 'LocDetails',
|
||||
req: {
|
||||
|
@ -287,7 +288,7 @@ const createClient = (profile, request = _request) => {
|
|||
.then((d) => {
|
||||
if (!Array.isArray(d.locL)) return []
|
||||
const parse = profile.parseNearby
|
||||
return d.locL.map(loc => parse(profile, opt, loc))
|
||||
return d.locL.map(loc => parse(profile, opt, d, loc))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -78,8 +78,8 @@ const createParseJourney = (profile, opt, data) => {
|
|||
return parseJourneyWithTickets
|
||||
}
|
||||
|
||||
const createParseMovement = (profile, data) => {
|
||||
const _parseMovement = _createParseMovement(profile, data)
|
||||
const createParseMovement = (profile, opt, data) => {
|
||||
const _parseMovement = _createParseMovement(profile, opt, data)
|
||||
const parseMovement = (m) => {
|
||||
const res = _parseMovement(m)
|
||||
// filter out empty nextStops entries
|
||||
|
|
Loading…
Add table
Reference in a new issue