"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeColumnsOptions = void 0;
const getColumnsMap_1 = require("../getColumnsMap");
const mergeColumnsOptions = (columns, childrenColumns) => {
    if (!childrenColumns) {
        return columns;
    }
    const childrenColumnsMap = (0, getColumnsMap_1.getColumnsMap)(childrenColumns);
    if (!Object.keys(childrenColumnsMap).length) {
        return columns;
    }
    return columns.map((column) => {
        if (!column.hasOwnProperty('field')) {
            return column;
        }
        return {
            ...column,
            // biome-ignore lint/suspicious/noTsIgnore: <>
            // @ts-ignore
            ...(childrenColumnsMap[column.field] || {}),
        };
    });
};
exports.mergeColumnsOptions = mergeColumnsOptions;
