Skip to content

Commit b443b8e

Browse files
committed
Allow to use dynamic namespace
1 parent 4baa8b8 commit b443b8e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/decorators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {ResultTypes} from "./metadata/types/ResultTypes";
1414
*
1515
* @param namespace Namespace in which this controller's events will be registered.
1616
*/
17-
export function SocketController(namespace?: string) {
17+
export function SocketController(namespace?: string|RegExp) {
1818
return function (object: Function) {
1919
const metadata: SocketControllerMetadataArgs = {
2020
namespace: namespace,

src/metadata/ControllerMetadata.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ export class ControllerMetadata {
2121
/**
2222
* Base route for all actions registered in this controller.
2323
*/
24-
namespace: string;
24+
namespace: string | RegExp;
2525

2626
// -------------------------------------------------------------------------
2727
// Constructor
2828
// -------------------------------------------------------------------------
29-
29+
3030
constructor(args: SocketControllerMetadataArgs) {
3131
this.target = args.target;
3232
this.namespace = args.namespace;
@@ -39,5 +39,5 @@ export class ControllerMetadata {
3939
get instance(): any {
4040
return getFromContainer(this.target);
4141
}
42-
42+
4343
}

src/metadata/args/SocketControllerMetadataArgs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export interface SocketControllerMetadataArgs {
1111
/**
1212
* Extra namespace in which this controller's events will be registered.
1313
*/
14-
namespace?: string;
15-
14+
namespace?: string|RegExp;
15+
1616
}

0 commit comments

Comments
 (0)