mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
rename station(id) -> stop(id) 💥
This commit is contained in:
parent
bbff1f4c63
commit
bad0af8e25
1 changed files with 7 additions and 7 deletions
14
index.js
14
index.js
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue