gitignore lockfile, add & remove todos, minor changes

This commit is contained in:
Jannis R 2018-06-13 20:25:56 +02:00
parent 47155cdb83
commit 3e18f5d415
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
10 changed files with 10 additions and 8 deletions

2
.gitignore vendored
View file

@ -4,3 +4,5 @@ Thumbs.db
.nvm-version
node_modules
npm-debug.log
package-lock.json

View file

@ -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

View file

@ -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.

View file

@ -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?

View file

@ -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]) {

View file

@ -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'}

View file

@ -2,7 +2,6 @@
const slugg = require('slugg')
// todo: is passing in profile necessary?
const parseOperator = (profile, a) => {
return {
type: 'operator',

View file

@ -1,6 +1,5 @@
'use strict'
// todo: is passing in profile necessary?
const parseRemark = (profile, r) => {
return null // todo
}

View file

@ -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)
[![npm version](https://img.shields.io/npm/v/hafas-client.svg)](https://www.npmjs.com/package/hafas-client)
[![build status](https://img.shields.io/travis/public-transport/hafas-client.svg)](https://travis-ci.org/public-transport/hafas-client)
[![build status](https://img.shields.io/travis/public-transport/hafas-client.svg?branch=master)](https://travis-ci.org/public-transport/hafas-client)
![ISC-licensed](https://img.shields.io/github/license/public-transport/hafas-client.svg)
[![chat on gitter](https://badges.gitter.im/public-transport/Lobby.svg)](https://gitter.im/public-transport/Lobby)
[![support me on Patreon](https://img.shields.io/badge/support%20me-on%20patreon-fa7664.svg)](https://patreon.com/derhuerst)

View file

@ -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') => {