diff --git a/format/location.js b/format/location.js index 39f0a990..eb243d16 100644 --- a/format/location.js +++ b/format/location.js @@ -3,7 +3,9 @@ const formatLocation = (profile, l, name = 'location') => { if ('string' === typeof l) return profile.formatStation(l) if ('object' === typeof l && !Array.isArray(l)) { - if (l.type === 'station') return profile.formatStation(l.id) + if (l.type === 'station' || l.type === 'stop') { + return profile.formatStation(l.id) + } if ('string' === typeof l.id) return profile.formatPoi(l) if ('string' === typeof l.address) return profile.formatAddress(l) if (!l.type) throw new Error(`missing ${name}.type`) diff --git a/package.json b/package.json index d6c9682c..56b377da 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hafas-client", "description": "Client for HAFAS public transport APIs.", - "version": "3.8.0", + "version": "3.8.1", "main": "index.js", "files": [ "index.js", diff --git a/test/vbb.js b/test/vbb.js index 4be3e1a2..1fa7d620 100644 --- a/test/vbb.js +++ b/test/vbb.js @@ -50,7 +50,11 @@ const wedding = '900000009104' const württembergallee = '900000026153' test('journeys – Spichernstr. to Bismarckstr.', co(function* (t) { - const journeys = yield client.journeys(spichernstr, bismarckstr, { + const journeys = yield client.journeys({ + type: 'stop', + id: spichernstr, + name: 'U Spichernstr.' + }, bismarckstr, { results: 3, departure: when, stopovers: true