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

see #17 for reasons
closes #17
This commit is contained in:
Jannis R 2018-06-04 19:00:19 +02:00 committed by Jannis Redmann
parent 21c273cec7
commit 665bed9f79
6 changed files with 7 additions and 7 deletions

View file

@ -221,7 +221,7 @@ const createClient = (profile, request = _request) => {
})
}
const location = (station) => {
const station = (station) => {
if ('object' === typeof station) station = profile.formatStation(station.id)
else if ('string' === typeof station) station = profile.formatStation(station)
else throw new Error('station must be an object or a string.')
@ -368,7 +368,7 @@ const createClient = (profile, request = _request) => {
})
}
const client = {departures, journeys, locations, location, nearby}
const client = {departures, journeys, locations, station, nearby}
if (profile.journeyLeg) client.journeyLeg = journeyLeg
if (profile.radar) client.radar = radar
Object.defineProperty(client, 'profile', {value: profile})

View file

@ -10,7 +10,7 @@ client.journeys('8011167', '8000261', {results: 1, tickets: true})
// client.departures('8011167', {duration: 1})
// client.locations('Berlin Jungfernheide')
// client.locations('Atze Musiktheater', {poi: true, addressses: false, fuzzy: false})
// client.location('8000309') // Regensburg Hbf
// client.station('8000309') // Regensburg Hbf
// client.nearby(52.4751309, 13.3656537, {results: 1})
.then((data) => {

View file

@ -10,7 +10,7 @@ client.journeys('008010226', '008013456', {results: 1})
// client.departures('008010226', { duration: 5 })
// client.locations('Magdeburg Hbf', {results: 2})
// client.locations('Kunstmuseum Kloster Unser Lieben Frauen Magdeburg', {results: 2})
// client.location('008010226') // Magdeburg-Neustadt
// client.station('008010226') // Magdeburg-Neustadt
// client.nearby({
// type: 'location',
// latitude: 52.148842,

View file

@ -10,7 +10,7 @@ client.journeys('8000103', '8000199', {results: 10, tickets: true})
// client.departures('8000199', {duration: 10})
// client.journeyLeg('1|30161|5|100|14032018', 'Bus 52')
// client.locations('Schleswig', {results: 1})
// client.location('706990') // Kiel Holunderbusch
// client.station('706990') // Kiel Holunderbusch
// client.nearby({type: 'location', latitude: 54.295691, longitude: 10.116424}, {distance: 60})
// client.radar(54.4, 10.0, 54.2, 10.2, {results: 10})

View file

@ -9,7 +9,7 @@ const client = createClient(oebbProfile)
client.journeys('1291501', '8100002', {results: 1})
// client.departures('8100002', {duration: 1})
// client.locations('Salzburg', {results: 2})
// client.location('8100173') // Graz Hbf
// client.station('8100173') // Graz Hbf
// client.nearby(47.812851, 13.045604, {distance: 60})
// client.radar({
// north: 47.827203,

View file

@ -9,7 +9,7 @@ const client = createClient(vbbProfile)
client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
// client.departures('900000013102', {duration: 1})
// client.locations('Alexanderplatz', {results: 2})
// client.location('900000042101') // Spichernstr
// client.station('900000042101') // Spichernstr
// client.nearby(52.5137344, 13.4744798, {distance: 60})
// client.radar({
// north: 52.52411,