departures/arrivals, locations, nearby, stop: opt.stationLines -> linesOfStops 💥 📝

This commit is contained in:
Jannis R 2019-01-23 13:03:01 +08:00
parent 8f9b22e296
commit a972dad7b8
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
15 changed files with 21 additions and 21 deletions

View file

@ -27,7 +27,7 @@ With `opt`, you can override the default options, which look like this:
when: new Date(),
direction: null, // only show departures heading to this station
duration: 10, // show departures for the next n minutes
stationLines: false, // parse & expose lines of the station?
linesOfStops: false, // parse & expose lines at the stop/station?
remarks: true, // parse & expose hints & warnings?
stopovers: false, // fetch & parse previous/next stopovers?
// departures at related stations

View file

@ -11,7 +11,7 @@ With `opt`, you can override the default options, which look like this:
, stops: true // return stops/stations?
, addresses: true
, poi: true // points of interest
, stationLines: false // parse & expose lines of the station?
, linesOfStops: false // parse & expose lines at each stop/station?
, language: 'en' // language to get results in
}
```

View file

@ -12,7 +12,7 @@ With `opt`, you can override the default options, which look like this:
distance: null, // maximum walking distance in meters
poi: false, // return points of interest?
stops: true, // return stops/stations?
stationLines: false, // parse & expose lines of the station?
linesOfStops: false, // parse & expose lines at each stop/station?
language: 'en' // language to get results in
}
```

View file

@ -23,7 +23,7 @@ With `opt`, you can override the default options, which look like this:
```js
{
stationLines: false, // parse & expose lines of the stop/station?
linesOfStops: false, // parse & expose lines at the stop/station?
language: 'en' // language to get results in
}
```

View file

@ -59,7 +59,7 @@ const createClient = (profile, userAgent, request = _request) => {
opt = Object.assign({
direction: null, // only show departures heading to this station
duration: 10, // show departures for the next n minutes
stationLines: false, // parse & expose lines of the station?
linesOfStops: false, // parse & expose lines at the stop/station?
remarks: true, // parse & expose hints & warnings?
stopovers: false, // fetch & parse previous/next stopovers?
// departures at related stations
@ -300,7 +300,7 @@ const createClient = (profile, userAgent, request = _request) => {
stops: true, // return stops/stations?
addresses: true,
poi: true, // points of interest
stationLines: false // parse & expose lines of the station?
linesOfStops: false // parse & expose lines at each stop/station?
}, opt)
const f = profile.formatLocationFilter(opt.stops, opt.addresses, opt.poi)
@ -329,7 +329,7 @@ const createClient = (profile, userAgent, request = _request) => {
else throw new Error('stop must be an object or a string.')
opt = Object.assign({
stationLines: false // parse & expose lines of the stop/station?
linesOfStops: false // parse & expose lines at the stop/station?
}, opt)
return request(profile, userAgent, opt, {
meth: 'LocDetails',
@ -354,7 +354,7 @@ const createClient = (profile, userAgent, request = _request) => {
distance: null, // maximum walking distance in meters
poi: false, // return points of interest?
stops: true, // return stops/stations?
stationLines: false // parse & expose lines of the station?
linesOfStops: false // parse & expose lines at each stop/station?
}, opt)
return request(profile, userAgent, opt, {

View file

@ -8,9 +8,9 @@ const client = createClient(vbbProfile, 'hafas-client-example')
// Hauptbahnhof to Charlottenburg
client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
// client.departures('900000013102', {duration: 1})
// client.arrivals('900000013102', {duration: 10, stationLines: true})
// client.arrivals('900000013102', {duration: 10, linesOfStops: true})
// client.locations('Alexanderplatz', {results: 2})
// client.stop('900000042101', {stationLines: true}) // Spichernstr
// client.stop('900000042101', {linesOfStops: true}) // Spichernstr
// client.nearby({
// type: 'location',
// latitude: 52.5137344,

View file

@ -8,7 +8,7 @@ const client = createClient(cmtaProfile, 'hafas-client-example')
// Broadie Oaks to Domain
client.journeys('000002370', '000005919', {results: 1, polylines: true})
// client.departures('000002370', {duration: 1})
// client.arrivals('000002370', {duration: 10, stationLines: true})
// client.arrivals('000002370', {duration: 10, linesOfStops: true})
// client.locations('Westgate', {results: 2})
// client.stop('000005534') // Downtown light rail station
// client.nearby({

View file

@ -8,7 +8,7 @@ const client = createClient(dbProfile, 'hafas-client-example')
// Berlin Jungfernheide to München Hbf
client.journeys('8011167', '8000261', {results: 1, tickets: true})
// client.departures('8011167', {duration: 1})
// client.arrivals('8011167', {duration: 10, stationLines: true})
// client.arrivals('8011167', {duration: 10, linesOfStops: true})
// client.locations('Berlin Jungfernheide')
// client.locations('Atze Musiktheater', {poi: true, addressses: false, fuzzy: false})
// client.stop('8000309') // Regensburg Hbf

View file

@ -8,7 +8,7 @@ const client = createClient(insaProfile, 'hafas-client-example')
// from Magdeburg-Neustadt to Magdeburg-Buckau
client.journeys('008010226', '008013456', {results: 1})
// client.departures('008010226', { duration: 5 })
// client.arrivals('8010226', {duration: 10, stationLines: true})
// client.arrivals('8010226', {duration: 10, linesOfStops: true})
// client.locations('Magdeburg Hbf', {results: 2})
// client.locations('Kunstmuseum Kloster Unser Lieben Frauen Magdeburg', {results: 2})
// client.stop('008010226') // Magdeburg-Neustadt

View file

@ -8,7 +8,7 @@ const client = createClient(nahshProfile, 'hafas-client-example')
// Flensburg Hbf to Kiel Hbf
client.journeys('8000103', '8000199', {results: 10, tickets: true})
// client.departures('8000199', {duration: 10})
// client.arrivals('8000199', {duration: 5, stationLines: true})
// client.arrivals('8000199', {duration: 5, linesOfStops: true})
// client.trip('1|30161|5|100|14032018', 'Bus 52')
// client.locations('Schleswig', {results: 1})
// client.stop('706990') // Kiel Holunderbusch

View file

@ -8,7 +8,7 @@ const client = createClient(oebbProfile, 'hafas-client-example')
// Wien Westbahnhof to Salzburg Hbf
client.journeys('1291501', '8100002', {results: 1})
// client.departures('8100002', {duration: 1})
// client.arrivals('8100002', {duration: 10, stationLines: true})
// client.arrivals('8100002', {duration: 10, linesOfStops: true})
// client.locations('Salzburg', {results: 2})
// client.stop('8100173') // Graz Hbf
// client.nearby({

View file

@ -17,7 +17,7 @@ client.journeys('15541', '10609', {results: 1})
// })
// client.departures('15541', {duration: 1})
// client.arrivals('15541', {duration: 10, stationLines: true})
// client.arrivals('15541', {duration: 10, linesOfStops: true})
// client.locations('uhlandstr', {results: 2})
// client.station('10609') // Uhlandstr., Saarbrücken
// client.nearby({

View file

@ -8,9 +8,9 @@ const client = createClient(vbbProfile, 'hafas-client-example')
// Mittersendling to Charlottenburg
// client.journeys('8004154', '0621790', {results: 1, polylines: true})
client.departures('8004154', {duration: 5})
// client.arrivals('8004154', {duration: 10, stationLines: true})
// client.arrivals('8004154', {duration: 10, linesOfStops: true})
// client.locations('mittersendling', {results: 5})
// client.stop('8004154', {stationLines: true}) // Mittersendling
// client.stop('8004154', {linesOfStops: true}) // Mittersendling
// client.nearby({
// type: 'location',
// latitude: 48.153858,

View file

@ -8,9 +8,9 @@ const client = createClient(vbbProfile, 'hafas-client-example')
// Hauptbahnhof to Charlottenburg
client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
// client.departures('900000013102', {duration: 1})
// client.arrivals('900000013102', {duration: 10, stationLines: true})
// client.arrivals('900000013102', {duration: 10, linesOfStops: true})
// client.locations('Alexanderplatz', {results: 2})
// client.stop('900000042101', {stationLines: true}) // Spichernstr
// client.stop('900000042101', {linesOfStops: true}) // Spichernstr
// client.nearby({
// type: 'location',
// latitude: 52.5137344,

View file

@ -25,7 +25,7 @@ const parseLocation = (profile, opt, {lines}, l) => {
if ('pCls' in l) stop.products = profile.parseProducts(l.pCls)
if (
opt.stationLines &&
opt.linesOfStops &&
Array.isArray(l.pRefL) &&
Array.isArray(lines)
) {