Do not use _.omit()
This commit is contained in:
parent
8ac041805c
commit
b5d2de8edc
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user