UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

19 lines (18 loc) 547 B
export const WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg'; export const isWeightedAverageAggFuncName = (aggFunc) => { return aggFunc === WEIGHTED_AVERAGE_AGG_FN_NAME; }; export const isWeightedAverageAggregation = (aggFunc) => { return aggFunc?.type === 'weightedAverage'; }; export const getAggFuncName = (aggFunc) => { if (isWeightedAverageAggregation(aggFunc)) { return WEIGHTED_AVERAGE_AGG_FN_NAME; } else if (typeof aggFunc === 'string') { return aggFunc; } else { return aggFunc; } };