import { isArray, isString } from "@visactor/vutils";

export function getGroupByDataConfig(groupByOption, addRecordRule) {
    if (isString(groupByOption)) return {
        groupByRules: [ groupByOption ],
        addRecordRule: addRecordRule
    };
    if (isArray(groupByOption)) {
        return {
            groupByRules: groupByOption.map((item => isString(item) ? item : item.key)),
            addRecordRule: addRecordRule
        };
    }
    return {
        addRecordRule: addRecordRule
    };
}
//# sourceMappingURL=group-helper.js.map