Skip to content

Commit

Permalink
chore(microservices): correct argument naming on pattern decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneKorshenko committed Jan 24, 2022
1 parent 95643fc commit a0f148d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions packages/microservices/decorators/event-pattern.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ export const EventPattern: {
): MethodDecorator;
} = <T = string>(
metadata?: T,
arg1?: Transport | Record<string, any>,
arg2?: Record<string, any>,
transportOrExtras?: Transport | Record<string, any>,
maybeExtras?: Record<string, any>,
): MethodDecorator => {
let transport: Transport;
let extras: Record<string, any>;
if (isNumber(arg1) && isNil(arg2)) {
transport = arg1;
} else if (isObject(arg1) && isNil(arg2)) {
extras = arg1;
if (isNumber(transportOrExtras) && isNil(maybeExtras)) {
transport = transportOrExtras;
} else if (isObject(transportOrExtras) && isNil(maybeExtras)) {
extras = transportOrExtras;
} else {
transport = arg1 as Transport;
extras = arg2;
transport = transportOrExtras as Transport;
extras = maybeExtras;
}
return (
target: object,
Expand Down
16 changes: 8 additions & 8 deletions packages/microservices/decorators/message-pattern.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ export const MessagePattern: {
): MethodDecorator;
} = <T = PatternMetadata | string>(
metadata?: T,
arg1?: Transport | Record<string, any>,
arg2?: Record<string, any>,
transportOrExtras?: Transport | Record<string, any>,
maybeExtras?: Record<string, any>,
): MethodDecorator => {
let transport: Transport;
let extras: Record<string, any>;
if (isNumber(arg1) && isNil(arg2)) {
transport = arg1;
} else if (isObject(arg1) && isNil(arg2)) {
extras = arg1;
if (isNumber(transportOrExtras) && isNil(maybeExtras)) {
transport = transportOrExtras;
} else if (isObject(transportOrExtras) && isNil(maybeExtras)) {
extras = transportOrExtras;
} else {
transport = arg1 as Transport;
extras = arg2;
transport = transportOrExtras as Transport;
extras = maybeExtras;
}
return (
target: object,
Expand Down

0 comments on commit a0f148d

Please sign in to comment.