"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const extractInterface_1 = require("../../../../../extractInterface");
const Async_1 = require("../../../../../types/interface/async/Async");
const _ids_1 = require("../../../../_ids");
class DeepGet0 extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['obj', 'path'],
            o: ['value'],
        }, {
            input: {
                obj: {
                    ref: true,
                },
            },
            output: {
                value: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_DEEP_GET_1);
    }
    async f({ obj, path }, done) {
        let value_;
        try {
            value_ = await obj.deepGet(path);
        }
        catch (err) {
            done(undefined, err.message);
            return;
        }
        const _ = (0, extractInterface_1.extractInterface)(value_);
        const value = (0, Async_1.Async)(value_, _, this.__system.async);
        done({
            value,
        });
    }
}
exports.default = DeepGet0;
//# sourceMappingURL=index.js.map