homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge
16 lines (15 loc) • 678 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
function WebSocketGateway(portOrOptions, options) {
const isPortInt = Number.isInteger(portOrOptions);
// tslint:disable-next-line:prefer-const
let [port, opt] = isPortInt ? [portOrOptions, options] : [0, portOrOptions];
opt = opt || {};
return (target) => {
Reflect.defineMetadata(constants_1.GATEWAY_METADATA, true, target);
Reflect.defineMetadata(constants_1.PORT_METADATA, port, target);
Reflect.defineMetadata(constants_1.GATEWAY_OPTIONS, opt, target);
};
}
exports.WebSocketGateway = WebSocketGateway;