From 08f8bce4a7809fcc566cacb4a9d6ffefb67fdb2e Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Mon, 6 Jan 2020 15:46:02 -0500 Subject: [PATCH] Fix some code tests --- modules/services/taginfo.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/services/taginfo.js b/modules/services/taginfo.js index 87d958765..6d713ceca 100644 --- a/modules/services/taginfo.js +++ b/modules/services/taginfo.js @@ -106,26 +106,27 @@ function filterRoles(geometry) { function valKey(d) { return { value: d.key, - title: d.key, - count: d.count + title: d.key }; } function valKeyDescription(d) { - return { + var obj = { value: d.value, - title: d.description || d.value, - count: d.count + title: d.description || d.value }; + if (d.count) { + obj.count = d.count; + } + return obj; } function roleKey(d) { return { value: d.role, - title: d.role, - count: d.count + title: d.role }; }