Skip to content

Commit a0f148d

Browse files
chore(microservices): correct argument naming on pattern decorators
1 parent 95643fc commit a0f148d

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

packages/microservices/decorators/event-pattern.decorator.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ export const EventPattern: {
2222
): MethodDecorator;
2323
} = <T = string>(
2424
metadata?: T,
25-
arg1?: Transport | Record<string, any>,
26-
arg2?: Record<string, any>,
25+
transportOrExtras?: Transport | Record<string, any>,
26+
maybeExtras?: Record<string, any>,
2727
): MethodDecorator => {
2828
let transport: Transport;
2929
let extras: Record<string, any>;
30-
if (isNumber(arg1) && isNil(arg2)) {
31-
transport = arg1;
32-
} else if (isObject(arg1) && isNil(arg2)) {
33-
extras = arg1;
30+
if (isNumber(transportOrExtras) && isNil(maybeExtras)) {
31+
transport = transportOrExtras;
32+
} else if (isObject(transportOrExtras) && isNil(maybeExtras)) {
33+
extras = transportOrExtras;
3434
} else {
35-
transport = arg1 as Transport;
36-
extras = arg2;
35+
transport = transportOrExtras as Transport;
36+
extras = maybeExtras;
3737
}
3838
return (
3939
target: object,

packages/microservices/decorators/message-pattern.decorator.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ export const MessagePattern: {
3636
): MethodDecorator;
3737
} = <T = PatternMetadata | string>(
3838
metadata?: T,
39-
arg1?: Transport | Record<string, any>,
40-
arg2?: Record<string, any>,
39+
transportOrExtras?: Transport | Record<string, any>,
40+
maybeExtras?: Record<string, any>,
4141
): MethodDecorator => {
4242
let transport: Transport;
4343
let extras: Record<string, any>;
44-
if (isNumber(arg1) && isNil(arg2)) {
45-
transport = arg1;
46-
} else if (isObject(arg1) && isNil(arg2)) {
47-
extras = arg1;
44+
if (isNumber(transportOrExtras) && isNil(maybeExtras)) {
45+
transport = transportOrExtras;
46+
} else if (isObject(transportOrExtras) && isNil(maybeExtras)) {
47+
extras = transportOrExtras;
4848
} else {
49-
transport = arg1 as Transport;
50-
extras = arg2;
49+
transport = transportOrExtras as Transport;
50+
extras = maybeExtras;
5151
}
5252
return (
5353
target: object,

0 commit comments

Comments
 (0)