From b0399215cdc6cfac30616a0fe9565921a7c93588 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sat, 20 May 2017 15:42:08 +0200 Subject: [PATCH] bugfixes :bug:, 1.0.1 - fixed `destination` & `departure` of a journey - location IDs should be strings (according to FPTF) --- package.json | 2 +- parse.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 75e8273e..e64564af 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hafas-client", "description": "JavaScript client for HAFAS mobile APIs.", - "version": "1.0.0", + "version": "1.0.1", "main": "index.js", "files": ["index.js", "parse.js", "stringify.js"], "author": "Jannis R ", diff --git a/parse.js b/parse.js index f7e8173d..8910e428 100644 --- a/parse.js +++ b/parse.js @@ -29,7 +29,7 @@ const location = (l) => { longitude: l.crd.x / 1000000 } : 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 return result } @@ -132,8 +132,8 @@ const journey = (tz, s, ln, r) => (c) => { return { parts , origin: parts[0].origin - , destination: parts[0].destination - , departure: parts[parts.length - 1].departure + , destination: parts[parts.length - 1].destination + , departure: parts[0].departure , arrival: parts[parts.length - 1].arrival } }