@digitransit-util/digitransit-util-enrich-patterns
v1.1.2
Published
digitransit-util enrich-patterns module
Downloads
3
Maintainers
Readme
@digitransit-util/digitransit-util-enrich-patterns
enrichPatterns
Parameters
patterns
object Array of patterns (result from GraphiQL query)onlyInFuture
boolean Is filtered out today's past tripsserviceTimeRange
number How many days shows in UI
Examples
digitransit-util.enrichPatterns([ { code: 'HSL:3002U:0:02', headsign: 'Kirkkonummi', stops: [{ name: 'Helsinki' }, { name: 'Kirkkonummi' }], tripsForDate: [], activeDates: [{ "day": [ "20200329" ] },{ "day": [ "20200329" ] },{ "day": [ "20200329" ] }, { "day": [ "20200329" ] }] } ], true, 30);
//=[ { code: 'HSL:3002U:0:02', headsign: 'Kirkkonummi', stops: [{ name: 'Helsinki' }, { name: 'Kirkkonummi' }], tripsForDate: [], activeDates: ["20200221","20200222","20200228","20200229"], } ]
Returns Object enriched pattern
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-util/digitransit-util-enrich-patterns
Or install the Digitransit-util module that includes it as a function:
$ npm install @digitransit-util/digitransit-util