"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.appendPatch = void 0;
exports.getConditionByType = getConditionByType;
const lodash_es_1 = require("lodash-es");
function getConditionByType(conditions, type) {
    return conditions.find((c) => c.type === type);
}
const appendPatch = (patches, path, newVal, existingVal) => {
    if (!(0, lodash_es_1.isEqual)(newVal, existingVal)) {
        patches.push({
            op: existingVal === undefined ? 'add' : 'replace',
            path,
            value: newVal,
        });
    }
};
exports.appendPatch = appendPatch;
//# sourceMappingURL=utils.js.map