parse fn signatures: bugfixes 🐛

This commit is contained in:
Jannis R 2018-06-26 11:48:30 +02:00
parent 4c86b625c7
commit b02f012b18
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 4 additions and 3 deletions

View file

@ -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))
})
}

View file

@ -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