"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "valueSetter", {
    enumerable: true,
    get: function() {
        return valueSetter;
    }
});
const _object = require("../../../helpers/object");
function valueSetter(newValue, row, column) {
    if (Array.isArray(newValue)) {
        const sourceDataAtCell = this.getSourceDataAtCell(this.toPhysicalRow(row), column);
        if (Array.isArray(sourceDataAtCell) && sourceDataAtCell.length > 0 && (0, _object.isKeyValueObject)(sourceDataAtCell[0])) {
            return newValue.map((val)=>{
                return (0, _object.isKeyValueObject)(val) ? val : {
                    key: val,
                    value: val
                };
            });
        }
    }
    return newValue;
}
