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);
}
buckets = result.rows.map(function(row) {
return _.omit(
row,
'bins_number',
'bin_width',
'nulls_count',
'infinities_count',
'nans_count',
'avg_val',
'timestamp_start'
);
});
// TODO: after applying strategy we could use specialized .format()
// in order to know what props we want to expose using destructuring assignment
const blacklisted = [
'bins_number',
'bin_width',
'nulls_count',
'infinities_count',
'nans_count',
'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 {