"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const _ids_1 = require("../../../../_ids");
class ToJson extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['body', 'any'],
            o: ['json'],
        }, {}, system, _ids_1.ID_TO_JSON);
    }
    async f({ body }, done, fail) {
        let json;
        try {
            json = await body.json();
        }
        catch (err) {
            fail(err.message.toLowerCase());
            return;
        }
        done({ json });
    }
}
exports.default = ToJson;
//# sourceMappingURL=index.js.map