"use strict";

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.getGroupByDataConfig = void 0;

const vutils_1 = require("@visactor/vutils");

function getGroupByDataConfig(groupByOption, addRecordRule) {
    if ((0, vutils_1.isString)(groupByOption)) return {
        groupByRules: [ groupByOption ],
        addRecordRule: addRecordRule
    };
    if ((0, vutils_1.isArray)(groupByOption)) {
        return {
            groupByRules: groupByOption.map((item => (0, vutils_1.isString)(item) ? item : item.key)),
            addRecordRule: addRecordRule
        };
    }
    return {
        addRecordRule: addRecordRule
    };
}

exports.getGroupByDataConfig = getGroupByDataConfig;
//# sourceMappingURL=group-helper.js.map