Skip to content

Commit

Permalink
tweak callback arg naming
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Aug 5, 2024
1 parent 3363e00 commit 03b8264
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ export const getMiniHistogramDataFromAggResponse = (
aggReponse: Record<string, MiniHistogramAgg>,
index: number
): SignificantItemHistogramItem[] =>
overallTimeSeries.map((o) => {
overallTimeSeries.map((overallTimeSeriesItem) => {
const current = aggReponse[`${MINI_HISTOGRAM_AGG_PREFIX}${index}`].mini_histogram.buckets.find(
(d1) => d1.key_as_string === o.key_as_string
(bucket) => bucket.key_as_string === overallTimeSeriesItem.key_as_string
) ?? {
doc_count: 0,
};

return {
key: o.key,
key_as_string: o.key_as_string ?? '',
key: overallTimeSeriesItem.key,
key_as_string: overallTimeSeriesItem.key_as_string ?? '',
doc_count_significant_item: current.doc_count,
doc_count_overall: Math.max(0, o.doc_count - current.doc_count),
doc_count_overall: Math.max(0, overallTimeSeriesItem.doc_count - current.doc_count),
};
}) ?? [];

0 comments on commit 03b8264

Please sign in to comment.