lexica-dialog-core
Version:
Core server for Lexica dialog agent.
12 lines • 486 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const immutable_1 = require("immutable");
const flattenResponsesMiddleware = async (context, next) => {
await next();
context.responses = immutable_1.List(context.commands
.toArray()
.map(command => command.botResponses)
.reduce((a, b) => a.concat(b), immutable_1.List()));
};
exports.default = flattenResponsesMiddleware;
//# sourceMappingURL=FlattenResponsesMiddleware.js.map