"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const _ids_1 = require("../../../_ids");
class IdToSpec extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['id'],
            o: ['spec'],
        }, {}, system, _ids_1.ID_ID_TO_SPEC);
    }
    f({ id }, done) {
        if (this.__system) {
            const { specs } = this.__system;
            const spec = specs[id];
            if (spec) {
                done({ spec });
            }
            else {
                done(undefined, 'cannot find spec with this id');
            }
        }
        else {
            done(undefined, 'not attached');
        }
    }
}
exports.default = IdToSpec;
//# sourceMappingURL=index.js.map