Browse Source

switched to `_.compact` to remove `undefined` values

pull/497/head
Stephen Hess 9 years ago
parent
commit
8d0b0e8780
  1. 4
      helper/labelGenerator.js

4
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

Loading…
Cancel
Save