@digitransit-search-util/digitransit-search-util-query-utils
v4.1.3
Published
digitransit-search-util query-utils module
Downloads
76
Maintainers
Readme
@digitransit-search-util/digitransit-search-util-query-utils
verify
Verifies that the data for favourites is coherent and current and fixes errors
Parameters
stopStationMap
favourites
setRelayEnvironment
Set you Relay environment
Parameters
environment
any Your Relay environment
getModesWithAlerts
Get alerts for modes
Parameters
getStopAndStationsQuery
Returns Stop and station objects .
Parameters
favourites
any
filterStopsAndStationsByMode
Returns Stop and station objects filtered by given mode based on mode information acquired from OTP by checking the modes of the departures on the given stops.
Parameters
stopsToFilter
anymode
String
getFavouriteRoutesQuery
Returns Favourite Route objects depending on input
Parameters
favourites
anyinput
String Search text, if empty no objects are returnedtransportMode
String If provided, all returned route objects are of this mode, e.g. 'BUS'pathOpts
an object containing two properties routesPrefix and stopsPrefix to override the URL paths returned by this method
getFavouriteVehicleRentalStationsQuery
Returns Favourite VehicleRentalStation objects depending on input
Parameters
favourites
anyinput
String Search text, if empty no objects are returned
getRoutesQuery
Returns Route objects depending on input
Parameters
input
String Search text, if empty no objects are returnedfeedIds
anytransportMode
String Filter routes with a transport mode, e.g. route-BUSpathOpts
an object containing two properties routesPrefix and stopsPrefix to override the URL paths returned by this method
filterSearchResultsByMode
Can be used to filter stops and stations by a given mode
Parameters
results
any search results from geocodingmode
any e.g 'BUS' or 'TRAM'type
any type of search results to filter, e.g 'Stops' or 'Routes'. This function only filters Stops because routes can be filtered with the query itself (optional, default'Stops'
)
This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @digitransit-search-util/digitransit-search-util-query-utils
Or install the digitransit-search-util module that includes it as a function:
$ npm install @digitransit-search-util/digitransit-search-util