Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public setupListeners(container, server: Server & CustomTransportStrategy) {
if (!this.listenersController) {
throw new RuntimeException();
}
const modules = container.getModules();
modules.forEach(({ routes }, module) =>
this.bindListeners(routes, server, module),
);
}
public setupClients(container) {
if (!this.listenersController) {
throw new RuntimeException();
}
const modules = container.getModules();
modules.forEach(({ routes, components }) => {
this.bindClients(routes);
this.bindClients(components);
});
}
public setupClients(container) {
if (!this.listenersController) {
throw new RuntimeException();
}
const modules = container.getModules();
modules.forEach(({ routes, components }) => {
this.bindClients(routes);
this.bindClients(components);
});
}
setupListeners(container, server) {
if (!this.listenersController) {
throw new runtime_exception_1.RuntimeException();
}
const modules = container.getModules();
modules.forEach(({ routes }, module) => this.bindListeners(routes, server, module));
}
setupClients(container) {
public setupListeners(container, server: Server & CustomTransportStrategy) {
if (!this.listenersController) {
throw new RuntimeException();
}
const modules = container.getModules();
modules.forEach(({ routes }, module) =>
this.bindListeners(routes, server, module),
);
}
setupListeners(container, server) {
if (!this.listenersController) {
throw new runtime_exception_1.RuntimeException();
}
const modules = container.getModules();
modules.forEach(({ routes }, module) => this.bindListeners(routes, server, module));
}
setupClients(container) {
setupClients(container) {
if (!this.listenersController) {
throw new runtime_exception_1.RuntimeException();
}
const modules = container.getModules();
modules.forEach(({ routes, components }) => {
this.bindClients(routes);
this.bindClients(components);
});
}
bindListeners(controllers, server, module) {
public bindMiddleware(
token: string,
components: Map>,
) {
if (!components.has(token)) {
throw new RuntimeException();
}
const { instance } = components.get(token);
if (!this.isGatewayMiddleware(instance)) return null;
const middleware = instance.resolve();
return isFunction(middleware) ? middleware.bind(instance) : null;
}
public bindMiddleware(
token: string,
components: Map>,
) {
if (!components.has(token)) {
throw new RuntimeException();
}
const { instance } = components.get(token);
if (!this.isGatewayMiddleware(instance)) return null;
const middleware = instance.resolve();
return isFunction(middleware) ? middleware.bind(instance) : null;
}
bindMiddleware(token, components) {
if (!components.has(token)) {
throw new runtime_exception_1.RuntimeException();
}
const { instance } = components.get(token);
if (!this.isGatewayMiddleware(instance))
return null;
const middleware = instance.resolve();
return shared_utils_1.isFunction(middleware) ? middleware.bind(instance) : null;
}
isGatewayMiddleware(middleware) {