From 8f9b22e296312dd6c3a3d7668ecceaf8ec14ed11 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 23 Jan 2019 12:58:05 +0800 Subject: [PATCH] locations, nearby: opt.stations -> opt.stops :boom: :memo: --- docs/locations.md | 2 +- docs/nearby.md | 2 +- format/location-filter.js | 6 +++--- index.js | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/locations.md b/docs/locations.md index 50f66ab6..000164bd 100644 --- a/docs/locations.md +++ b/docs/locations.md @@ -8,7 +8,7 @@ With `opt`, you can override the default options, which look like this: { fuzzy: true // find only exact matches? , results: 5 // how many search results? - , stations: true + , stops: true // return stops/stations? , addresses: true , poi: true // points of interest , stationLines: false // parse & expose lines of the station? diff --git a/docs/nearby.md b/docs/nearby.md index 972f8f0a..a732e93d 100644 --- a/docs/nearby.md +++ b/docs/nearby.md @@ -11,7 +11,7 @@ With `opt`, you can override the default options, which look like this: results: 8, // maximum number of results distance: null, // maximum walking distance in meters poi: false, // return points of interest? - stations: true, // return stations? + stops: true, // return stops/stations? stationLines: false, // parse & expose lines of the station? language: 'en' // language to get results in } diff --git a/format/location-filter.js b/format/location-filter.js index 79a79706..67dfa6e4 100644 --- a/format/location-filter.js +++ b/format/location-filter.js @@ -1,8 +1,8 @@ 'use strict' -const formatLocationFilter = (stations, addresses, poi) => { - if (stations && addresses && poi) return 'ALL' - return (stations ? 'S' : '') + (addresses ? 'A' : '') + (poi ? 'P' : '') +const formatLocationFilter = (stops, addresses, poi) => { + if (stops && addresses && poi) return 'ALL' + return (stops ? 'S' : '') + (addresses ? 'A' : '') + (poi ? 'P' : '') } module.exports = formatLocationFilter diff --git a/index.js b/index.js index fb5dc824..dd491acb 100644 --- a/index.js +++ b/index.js @@ -297,13 +297,13 @@ const createClient = (profile, userAgent, request = _request) => { opt = Object.assign({ fuzzy: true, // find only exact matches? results: 5, // how many search results? - stations: true, + stops: true, // return stops/stations? addresses: true, poi: true, // points of interest stationLines: false // parse & expose lines of the station? }, opt) - const f = profile.formatLocationFilter(opt.stations, opt.addresses, opt.poi) + const f = profile.formatLocationFilter(opt.stops, opt.addresses, opt.poi) return request(profile, userAgent, opt, { cfg: {polyEnc: 'GPA'}, meth: 'LocMatch', @@ -353,7 +353,7 @@ const createClient = (profile, userAgent, request = _request) => { results: 8, // maximum number of results distance: null, // maximum walking distance in meters poi: false, // return points of interest? - stations: true, // return stations? + stops: true, // return stops/stations? stationLines: false // parse & expose lines of the station? }, opt) @@ -370,7 +370,7 @@ const createClient = (profile, userAgent, request = _request) => { minDist: 0 }, getPOIs: !!opt.poi, - getStops: !!opt.stations, + getStops: !!opt.stops, maxLoc: opt.results } })