"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "valueSetter", {
    enumerable: true,
    get: function() {
        return valueSetter;
    }
});
const _mixed = require("../../../helpers/mixed");
function valueSetter(newValue, row, column) {
    const { checkedTemplate, uncheckedTemplate } = this.getCellMeta(row, column);
    const stringifiedValue = (0, _mixed.stringify)(newValue);
    const isChecked = stringifiedValue === (0, _mixed.stringify)(checkedTemplate);
    const isUnchecked = stringifiedValue === (0, _mixed.stringify)(uncheckedTemplate);
    if (isChecked || isUnchecked) {
        return isChecked ? checkedTemplate : uncheckedTemplate;
    }
    return newValue;
}
