UNPKG

@adaptabletools/adaptable-cjs

Version:

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

25 lines (24 loc) 956 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAggFuncName = exports.isWeightedAverageAggregation = exports.isWeightedAverageAggFuncName = exports.WEIGHTED_AVERAGE_AGG_FN_NAME = void 0; exports.WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg'; const isWeightedAverageAggFuncName = (aggFunc) => { return aggFunc === exports.WEIGHTED_AVERAGE_AGG_FN_NAME; }; exports.isWeightedAverageAggFuncName = isWeightedAverageAggFuncName; const isWeightedAverageAggregation = (aggFunc) => { return aggFunc?.type === 'weightedAverage'; }; exports.isWeightedAverageAggregation = isWeightedAverageAggregation; const getAggFuncName = (aggFunc) => { if ((0, exports.isWeightedAverageAggregation)(aggFunc)) { return exports.WEIGHTED_AVERAGE_AGG_FN_NAME; } else if (typeof aggFunc === 'string') { return aggFunc; } else { return aggFunc; } }; exports.getAggFuncName = getAggFuncName;