rename station(id) -> stop(id) 💥

This commit is contained in:
Jannis R 2018-11-21 19:54:40 +01:00
parent bbff1f4c63
commit bad0af8e25
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -318,18 +318,18 @@ const createClient = (profile, userAgent, request = _request) => {
}) })
} }
const station = (station, opt = {}) => { const stop = (stop, opt = {}) => {
if ('object' === typeof station) station = profile.formatStation(station.id) if ('object' === typeof stop) stop = profile.formatStation(stop.id)
else if ('string' === typeof station) station = profile.formatStation(station) else if ('string' === typeof stop) stop = profile.formatStation(stop)
else throw new Error('station must be an object or a string.') else throw new Error('stop must be an object or a string.')
opt = Object.assign({ opt = Object.assign({
stationLines: false // parse & expose lines of the station? stationLines: false // parse & expose lines of the stop/station?
}, opt) }, opt)
return request(profile, userAgent, opt, { return request(profile, userAgent, opt, {
meth: 'LocDetails', meth: 'LocDetails',
req: { req: {
locL: [station] locL: [stop]
} }
}) })
.then((d) => { .then((d) => {
@ -533,7 +533,7 @@ const createClient = (profile, userAgent, request = _request) => {
}) })
} }
const client = {departures, arrivals, journeys, locations, station, nearby} const client = {departures, arrivals, journeys, locations, stop, nearby}
if (profile.trip) client.trip = trip if (profile.trip) client.trip = trip
if (profile.radar) client.radar = radar if (profile.radar) client.radar = radar
if (profile.refreshJourney) client.refreshJourney = refreshJourney if (profile.refreshJourney) client.refreshJourney = refreshJourney