@digitransit-search-util/digitransit-search-util-filter-matching-to-input
v0.0.3
Published
digitransit-search-util filter-matching-to-input module
Downloads
88
Maintainers
Readme
@digitransit-search-util/digitransit-search-util-filter-matching-to-input
filterMatchingToInput
Function that filters list matching to input.
Parameters
list
Array List containin objects e.g( { type: 'Feature' properties: { label: 'testaddress4', layer: 'address', name: 'testaddress4', }, geometry: { coordinates: [lon, lat] }, },)Input
String Input given for filtering the listfields
Array List of fields that list is filtered by e.g ([properties.label, properties.name])
Examples
digitransit-util.filterMatchingToInput([{type: feature, properties { ... name: testaddress4 } ... }], 'testaddress4', 'properties.name');
//= List containing object with given name.
Returns Array Filtered Array.
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-filter-matching-to-input
Or install the Digitransit-util module that includes it as a function:
$ npm install @digitransit-util/digitransit-util