Use inline functions to filter desired fields of the row

This commit is contained in:
Daniel García Aubert 2017-09-11 19:24:01 +02:00
parent 5fc2b46d56
commit e3bffcd39d
2 changed files with 2 additions and 8 deletions

View File

@ -277,10 +277,7 @@ module.exports = class DateHistogram extends BaseHistogram {
}
_getBuckets (result) {
return result.rows.map(row => {
const { bin, min, max, avg, freq, timestamp } = row;
return { bin, min, max, avg, freq, timestamp };
});
return result.rows.map(({ bin, min, max, avg, freq, timestamp }) => ({ bin, min, max, avg, freq, timestamp }));
}
_getAggregation (override = {}) {

View File

@ -224,10 +224,7 @@ module.exports = class NumericHistogram extends BaseHistogram {
}
_getBuckets (result) {
return result.rows.map(row => {
const { bin, min, max, avg, freq } = row;
return { bin, min, max, avg, freq };
});
return result.rows.map(({ bin, min, max, avg, freq }) => ({ bin, min, max, avg, freq }));
}
_populateBinStart (firstRow, override = {}) {