"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAggFuncName = exports.isWeightedAverageAggregation = exports.isWeightedAverageAggFuncName = exports.ONLY_AGG_FN_NAME = exports.WEIGHTED_AVERAGE_AGG_FN_NAME = void 0;
exports.WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg';
exports.ONLY_AGG_FN_NAME = 'only';
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;
