Skip to content

Commit

Permalink
departures/arrivals, locations, nearby, stop: opt.stationLines -> lin…
Browse files Browse the repository at this point in the history
…esOfStops 💥 📝
  • Loading branch information
derhuerst committed Feb 28, 2019
1 parent 8f9b22e commit a972dad
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/departures.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/locations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/nearby.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/stop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand All @@ -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, {
Expand Down
4 changes: 2 additions & 2 deletions p/bvg/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion p/cmta/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion p/db/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion p/insa/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion p/nahsh/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion p/oebb/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion p/saarfahrplan/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions p/sbahn-muenchen/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions p/vbb/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion parse/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
) {
Expand Down

0 comments on commit a972dad

Please sign in to comment.