From 8d0b0e87807abd3e44459897d58fc9ba5d2bf581 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Thu, 14 Apr 2016 09:24:26 -0400 Subject: [PATCH] switched to `_.compact` to remove `undefined` values --- helper/labelGenerator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helper/labelGenerator.js b/helper/labelGenerator.js index eb35c86c..20c73a98 100644 --- a/helper/labelGenerator.js +++ b/helper/labelGenerator.js @@ -13,8 +13,8 @@ module.exports = function( record ){ labelParts.push(valueFunction(record)); } - // retain only things that are defined - labelParts = labelParts.filter(function(v) { return !_.isUndefined(v); }); + // retain only things that are truthy + labelParts = _.compact(labelParts); // first, dedupe the name and 1st label array elements // this is used to ensure that the `name` and first admin hierarchy elements aren't repeated