mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
gitignore lockfile, add & remove todos, minor changes
This commit is contained in:
parent
47155cdb83
commit
3e18f5d415
10 changed files with 10 additions and 8 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,3 +4,5 @@ Thumbs.db
|
|||
.nvm-version
|
||||
node_modules
|
||||
npm-debug.log
|
||||
|
||||
package-lock.json
|
||||
|
|
|
@ -23,6 +23,7 @@ With `opt`, you can override the default options, which look like this:
|
|||
|
||||
```js
|
||||
{
|
||||
// todo: products
|
||||
when: new Date(),
|
||||
direction: null, // only show departures heading to this station
|
||||
duration: 10 // show departures for the next n minutes
|
||||
|
|
|
@ -12,7 +12,7 @@ This guide is about writing such a profile. If you just want to use an already s
|
|||
|
||||
## 0. How do the profiles work?
|
||||
|
||||
A profile contains of three things:
|
||||
A profile may consist of three things:
|
||||
|
||||
- **mandatory details about the HAFAS endpoint**
|
||||
- `endpoint`: The protocol, host and path of the endpoint.
|
||||
|
|
1
index.js
1
index.js
|
@ -333,6 +333,7 @@ const createClient = (profile, request = _request) => {
|
|||
opt = Object.assign({
|
||||
results: 256, // maximum number of vehicles
|
||||
duration: 30, // compute frames for the next n seconds
|
||||
// todo: what happens with `frames: 0`?
|
||||
frames: 3, // nr of frames to compute
|
||||
products: null, // optionally an object of booleans
|
||||
polylines: false // return a track shape for each vehicle?
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
const {DateTime} = require('luxon')
|
||||
|
||||
const validDate = /^(\d{4})-(\d{2})-(\d{2})$/
|
||||
|
||||
const parseDateTime = (profile, date, time) => {
|
||||
const pDate = [date.substr(-8, 4), date.substr(-4, 2), date.substr(-2, 2)]
|
||||
if (!pDate[0] || !pDate[1] || !pDate[2]) {
|
||||
|
|
|
@ -5,8 +5,6 @@ const STATION = 'S'
|
|||
const ADDRESS = 'A'
|
||||
|
||||
// todo: what is s.rRefL?
|
||||
// todo: is passing in profile necessary?
|
||||
|
||||
// todo: [breaking] change to createParseLocation(profile, lines) => (l) => loc
|
||||
const parseLocation = (profile, l, lines) => {
|
||||
const res = {type: 'location'}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
const slugg = require('slugg')
|
||||
|
||||
// todo: is passing in profile necessary?
|
||||
const parseOperator = (profile, a) => {
|
||||
return {
|
||||
type: 'operator',
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
'use strict'
|
||||
|
||||
// todo: is passing in profile necessary?
|
||||
const parseRemark = (profile, r) => {
|
||||
return null // todo
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ HAFAS endpoint | wrapper library | docs | example code | source code
|
|||
[Nahverkehrsverbund Schleswig-Holstein (NAH.SH)](https://de.wikipedia.org/wiki/Nahverkehrsverbund_Schleswig-Holstein) | [`nahsh-hafas`](https://github.com/juliuste/nahsh-hafas) | [docs](p/nahsh/readme.md) | [example code](p/nahsh/example.js) | [src](p/nahsh/index.js)
|
||||
|
||||
[](https://www.npmjs.com/package/hafas-client)
|
||||
[](https://travis-ci.org/public-transport/hafas-client)
|
||||
[](https://travis-ci.org/public-transport/hafas-client)
|
||||

|
||||
[](https://gitter.im/public-transport/Lobby)
|
||||
[](https://patreon.com/derhuerst)
|
||||
|
|
|
@ -185,6 +185,8 @@ const createValidateJourneyLeg = (cfg) => {
|
|||
a.strictEqual(typeof leg.direction, 'string', msg)
|
||||
a.ok(leg.direction, name + '.direction must not be empty')
|
||||
}
|
||||
|
||||
// todo: validate polyline
|
||||
}
|
||||
return validateJourneyLeg
|
||||
}
|
||||
|
@ -277,6 +279,8 @@ const validateMovement = (val, m, name = 'movement') => {
|
|||
anyOf(['location', 'station'], val, f.destination, fName + '.destination')
|
||||
a.strictEqual(typeof f.t, 'number', fName + '.frames must be a number')
|
||||
}
|
||||
|
||||
// todo: validate polyline
|
||||
}
|
||||
|
||||
const validateMovements = (val, ms, name = 'movements') => {
|
||||
|
|
Loading…
Add table
Reference in a new issue