1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.WebSocketGateway = void 0;
|
4 | const constants_1 = require("../constants");
|
5 | function WebSocketGateway(portOrOptions, options) {
|
6 | const isPortInt = Number.isInteger(portOrOptions);
|
7 |
|
8 | let [port, opt] = isPortInt ? [portOrOptions, options] : [0, portOrOptions];
|
9 | opt = opt || {};
|
10 | return (target) => {
|
11 | Reflect.defineMetadata(constants_1.GATEWAY_METADATA, true, target);
|
12 | Reflect.defineMetadata(constants_1.PORT_METADATA, port, target);
|
13 | Reflect.defineMetadata(constants_1.GATEWAY_OPTIONS, opt, target);
|
14 | };
|
15 | }
|
16 | exports.WebSocketGateway = WebSocketGateway;
|