"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addItemsByIds = void 0;
const findObjectsByIds_1 = require("../findObjectsByIds");
/**
 * Добавляет элементы в value по массиву id
 */
const addItemsByIds = (value, idsToAdd, children, isObjectMode) => {
    if (idsToAdd.length === 0) {
        return value;
    }
    const currentValue = value || [];
    if (isObjectMode) {
        const objectsToAdd = (0, findObjectsByIds_1.findObjectsByIds)(children || [], idsToAdd);
        return [...currentValue, ...objectsToAdd];
    }
    return [...currentValue, ...idsToAdd];
};
exports.addItemsByIds = addItemsByIds;
