@digitransit-search-util/digitransit-search-util-query-utils v4.1.4
@digitransit-search-util/digitransit-search-util-query-utils
verify
Verifies that the data for favourites is coherent and current and fixes errors
Parameters
stopStationMapfavourites
setRelayEnvironment
Set you Relay environment
Parameters
environmentany Your Relay environment
getModesWithAlerts
Get alerts for modes
Parameters
getStopAndStationsQuery
Returns Stop and station objects .
Parameters
favouritesany
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
stopsToFilteranymodeString
getFavouriteRoutesQuery
Returns Favourite Route objects depending on input
Parameters
favouritesanyinputString Search text, if empty no objects are returnedtransportModeString If provided, all returned route objects are of this mode, e.g. 'BUS'pathOptsan 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
favouritesanyinputString Search text, if empty no objects are returned
getRoutesQuery
Returns Route objects depending on input
Parameters
inputString Search text, if empty no objects are returnedfeedIdsanytransportModeString Filter routes with a transport mode, e.g. route-BUSpathOptsan 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
resultsany search results from geocodingmodeany e.g 'BUS' or 'TRAM'typeany 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-utilsOr install the digitransit-search-util module that includes it as a function:
$ npm install @digitransit-search-util/digitransit-search-util8 months ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago