diff --git a/parse/location.js b/parse/location.js index c190fa21..8bb1da75 100644 --- a/parse/location.js +++ b/parse/location.js @@ -43,7 +43,7 @@ const parseLocation = (ctx, l) => { .filter(stop => !!stop) const stop = { - type: l.isMainMast ? 'station' : 'stop', + type: l.isMainMast || subStops.length > 0 ? 'station' : 'stop', id: res.id, name: l.name || lid.O ? profile.parseStationName(ctx, l.name || lid.O) : null, location: 'number' === typeof res.latitude ? res : null // todo: remove `.id` diff --git a/test/parse/location.js b/test/parse/location.js index 0f1aedf3..6d4cece5 100644 --- a/test/parse/location.js +++ b/test/parse/location.js @@ -156,7 +156,7 @@ test('handles recursive references properly', (t) => { } } const southernExpected = { - type: 'stop', + type: 'station', id: 'southern-platform', name: 'southern platform', // lower-cased! location: { @@ -177,7 +177,7 @@ test('handles recursive references properly', (t) => { ...fooBusStop, stopLocL: [0] }) - t.equal(type, 'stop') + t.equal(type, 'station') t.deepEqual(stops, [southernExpected]) t.end()