Fix summary generation when empty strings are present.

Also corrects step ordering when steps have equal durations.
This commit is contained in:
Daniel Patterson
2016-04-28 16:48:44 -07:00
committed by Patrick Niklaus
parent aab1aad8f4
commit f251f93a11
5 changed files with 88 additions and 4 deletions
+1
View File
@@ -71,6 +71,7 @@ module.exports = function () {
r.status = res.statusCode === 200 ? 'x' : null;
if (r.status) {
r.route = this.wayList(r.json.routes[0]);
r.summary = r.json.routes[0].legs.map(l => l.summary).join(',');
if (r.route.split(',')[0] === util.format('w%d', i)) {
r.time = r.json.routes[0].duration;