Do not use _.omit()

This commit is contained in:
Daniel García Aubert 2017-09-06 16:49:00 +02:00
parent 8ac041805c
commit b5d2de8edc

View File

@ -624,18 +624,23 @@ module.exports = class Histogram extends BaseWidget {
offset = this.getOffset(override); offset = this.getOffset(override);
} }
buckets = result.rows.map(function(row) { // TODO: after applying strategy we could use specialized .format()
return _.omit( // in order to know what props we want to expose using destructuring assignment
row,
'bins_number', const blacklisted = [
'bin_width', 'bins_number',
'nulls_count', 'bin_width',
'infinities_count', 'nulls_count',
'nans_count', 'infinities_count',
'avg_val', 'nans_count',
'timestamp_start' 'avg_val',
); 'timestamp_start'
}); ];
buckets = result.rows.map(row => Object.keys(row)
.filter((key) => blacklisted.indexOf(key) < 0)
.reduce((newObj, key) => Object.assign(newObj, { [key]: row[key] }), {})
);
} }
return { return {