gypsum
Version:
Simple and easy lightweight typescript server side framework on Node.js.
19 lines • 577 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("../types");
function toRoom(ctx, room) {
try {
room = typeof room === "string" ? room : room.toString();
ctx.response.room = ctx.response.room || room;
ctx.next();
}
catch (err) {
ctx.next({
message: "toRoom hook error: invalid room name!",
original: err,
code: types_1.RESPONSE_CODES.BAD_REQUEST
});
}
}
exports.toRoom = toRoom;
//# sourceMappingURL=to_room.js.map