"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const util_1 = require("../../../../../spec/util");
const weakMerge_1 = require("../../../../../weakMerge");
const _ids_1 = require("../../../../_ids");
class HasInput extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['unit', 'name'],
            o: ['test'],
        }, {}, system, _ids_1.ID_HAS_INPUT);
    }
    f({ unit, name }, done) {
        const { id } = unit.__bundle.unit;
        const spec = (0, util_1.getSpec)((0, weakMerge_1.weakMerge)(this.__system.specs, unit.__bundle.specs ?? {}), id);
        const { inputs = {} } = spec;
        const test = !!inputs[name];
        done({ test });
    }
}
exports.default = HasInput;
//# sourceMappingURL=index.js.map