diff --git a/index.js b/index.js index 68559d43..21ac30bb 100644 --- a/index.js +++ b/index.js @@ -225,7 +225,10 @@ const createClient = (profile) => { }) } - return {departures, journeys, locations, nearby, journeyPart, radar} + const client = {departures, journeys, locations, nearby} + if (profile.journeyPart) client.journeyPart = journeyPart + if (profile.radar) client.radar = radar + return client } module.exports = createClient diff --git a/lib/default-profile.js b/lib/default-profile.js index 32561573..8d673536 100644 --- a/lib/default-profile.js +++ b/lib/default-profile.js @@ -54,7 +54,10 @@ const defaultProfile = { formatStation, formatTime, formatLocation, - formatRectangle + formatRectangle, + + journeyPart: false, + radar: false } module.exports = defaultProfile diff --git a/p/vbb/index.js b/p/vbb/index.js index f16e84ba..9bfd1a9a 100644 --- a/p/vbb/index.js +++ b/p/vbb/index.js @@ -86,7 +86,10 @@ const vbbProfile = { parseProducts: createParseBitmask(modes.bitmasks), formatStation, - formatProducts + formatProducts, + + journeyPart: true, + radar: true } module.exports = vbbProfile diff --git a/test/util.js b/test/util.js index bc023dc1..309e84e7 100644 --- a/test/util.js +++ b/test/util.js @@ -26,7 +26,7 @@ const assertValidPoi = (t, p) => { t.equal(typeof p.name, 'string') t.ok(p.coordinates) - if (s.coordinates) { + if (p.coordinates) { t.equal(typeof p.coordinates.latitude, 'number') t.equal(typeof p.coordinates.longitude, 'number') } @@ -38,7 +38,7 @@ const assertValidAddress = (t, a) => { t.equal(typeof a.name, 'string') t.ok(a.coordinates) - if (s.coordinates) { + if (a.coordinates) { t.equal(typeof a.coordinates.latitude, 'number') t.equal(typeof a.coordinates.longitude, 'number') }