mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
minor stuff
This commit is contained in:
parent
7cf1261347
commit
ba9b7e8418
2 changed files with 4 additions and 3 deletions
1
index.js
1
index.js
|
@ -37,6 +37,7 @@ const createClient = (profile) => {
|
||||||
if (!Array.isArray(d.jnyL)) return [] // todo: throw err?
|
if (!Array.isArray(d.jnyL)) return [] // todo: throw err?
|
||||||
const parse = profile.parseDeparture(profile, d.locations, d.lines, d.remarks)
|
const parse = profile.parseDeparture(profile, d.locations, d.lines, d.remarks)
|
||||||
return d.jnyL.map(parse)
|
return d.jnyL.map(parse)
|
||||||
|
.sort((a, b) => new Date(a.when) - new Date(b.when))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# hafas-client
|
# hafas-client
|
||||||
|
|
||||||
**A client for HAFAS public transport APIs**. Sort of like [public-transport-enable](https://github.com/schildbach/public-transport-enabler), but with a smaller scope. It also has customisations for the following transport networks:
|
**A client for HAFAS public transport APIs**. Sort of like [public-transport-enable](https://github.com/schildbach/public-transport-enabler), but with a smaller scope. It also contains customisations for the following transport networks:
|
||||||
|
|
||||||
- [Deutsche Bahn](https://en.wikipedia.org/wiki/Deutsche_Bahn) – [src](p/db/index.js)
|
- [Deutsche Bahn](https://en.wikipedia.org/wiki/Deutsche_Bahn) – [src](p/db/index.js)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
## Background
|
## Background
|
||||||
|
|
||||||
There's [a company called HaCon](http://hacon.de) that sells [a public transport management system called HAFAS](https://de.wikipedia.org/wiki/HAFAS). It is [used by companies all over Europe](https://gist.github.com/derhuerst/2b7ed83bfa5f115125a5) to server routing and departure information for apps. All those endpoints are similar, with the same terms and API routes, but have slightly different options, filters and enable features.
|
There's [a company called HaCon](http://hacon.de) that sells [a public transport management system called HAFAS](https://de.wikipedia.org/wiki/HAFAS). It is [used by companies all over Europe](https://gist.github.com/derhuerst/2b7ed83bfa5f115125a5) to serve routing and departure information for apps. All those endpoints are similar, with the same terms and API routes, but have slightly different options, filters and enable features.
|
||||||
|
|
||||||
`hafas-client` contains all logic for communicating with these, as well as serialising from and parsing to [FPTF](https://github.com/public-transport/friendly-public-transport-format). Endpoint-specific customisations increase the quality of the returned data.
|
`hafas-client` contains all logic for communicating with these, as well as serialising from and parsing to [FPTF](https://github.com/public-transport/friendly-public-transport-format). Endpoint-specific customisations increase the quality of the returned data.
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ npm install hafas-client
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```js
|
||||||
const createClient = require('hafas-client')
|
const createClient = require('hafas-client')
|
||||||
const dbProfile = require('hafas-client/p/db')
|
const dbProfile = require('hafas-client/p/db')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue