From c8b2155908ace3231a88c1dcce797f40655ff64d Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 18 Jul 2016 20:18:06 +0200 Subject: [PATCH] locationFilter helper --- stringify.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stringify.js b/stringify.js index 15cfbe51..e7063b0c 100644 --- a/stringify.js +++ b/stringify.js @@ -30,10 +30,17 @@ const poi = (latitude, longitude, id, name) => { return {type: 'P', name, lid: 'L=' + id, crd: {x: coord(longitude), y: coord(latitude)}} } +const locationFilter = (stations, addresses, poi) => { + if (stations && addresses && poi) return 'ALL' + return (stations ? 'S' : '') + + (addresses ? 'A' : '') + + (poi ? 'P' : '') +} + module.exports = { date, time, bike, accessibility, - coord, station, address, poi + coord, station, address, poi, locationFilter }