bugfixes 🐛, 1.0.1

- fixed `destination` & `departure` of a journey
- location IDs should be strings (according to FPTF)
This commit is contained in:
Jannis R 2017-05-20 15:42:08 +02:00
parent 43ed330396
commit b0399215cd
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "hafas-client", "name": "hafas-client",
"description": "JavaScript client for HAFAS mobile APIs.", "description": "JavaScript client for HAFAS mobile APIs.",
"version": "1.0.0", "version": "1.0.1",
"main": "index.js", "main": "index.js",
"files": ["index.js", "parse.js", "stringify.js"], "files": ["index.js", "parse.js", "stringify.js"],
"author": "Jannis R <mail@jannisr.de>", "author": "Jannis R <mail@jannisr.de>",

View file

@ -29,7 +29,7 @@ const location = (l) => {
longitude: l.crd.x / 1000000 longitude: l.crd.x / 1000000
} : null } : null
} }
if (type === 'poi' || type === 'station') result.id = parseInt(l.extId) if (type === 'poi' || type === 'station') result.id = l.extId
if ('pCls' in l) result.products = l.pCls if ('pCls' in l) result.products = l.pCls
return result return result
} }
@ -132,8 +132,8 @@ const journey = (tz, s, ln, r) => (c) => {
return { return {
parts parts
, origin: parts[0].origin , origin: parts[0].origin
, destination: parts[0].destination , destination: parts[parts.length - 1].destination
, departure: parts[parts.length - 1].departure , departure: parts[0].departure
, arrival: parts[parts.length - 1].arrival , arrival: parts[parts.length - 1].arrival
} }
} }