"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const clone_1 = require("../../../../util/clone");
const object_1 = require("../../../../util/object");
const _ids_1 = require("../../../_ids");
class DeepSet extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['obj', 'path', 'value'],
            o: ['result'],
        }, {}, system, _ids_1.ID_DEEP_SET);
    }
    f({ obj, path, value }, done) {
        let result = (0, clone_1.clone)(obj);
        try {
            (0, object_1.deepSet)(result, path, value);
        }
        catch (err) {
            done(undefined, err.message);
            return;
        }
        done({
            result,
        });
    }
}
exports.default = DeepSet;
//# sourceMappingURL=index.js.map