Skip to content

Commit 3520c8c

Browse files
feat: improve typing (#22)
* feat: Improve typing * feat: Improve typing
1 parent 77ad2d1 commit 3520c8c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestjstools/messaging",
3-
"version": "2.13.0",
3+
"version": "2.14.0",
44
"description": "Simplifies asynchronous and synchronous message handling with support for buses, handlers, channels, and consumers. Build scalable, decoupled applications with ease and reliability.",
55
"author": "Sebastian Iwanczyszyn",
66
"license": "MIT",
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ConsumerMessage } from './consumer-message';
2+
13
export interface ConsumerMessageDispatcher {
2-
dispatch(message: object|string): void;
4+
dispatch(message: ConsumerMessage): void;
35
}

src/consumer/consumer-message.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ export class ConsumerMessage {
22
constructor(
33
public readonly message: object|string,
44
public readonly routingKey: string,
5-
public readonly metadata: any[] = [],
5+
public readonly metadata: {} = {},
66
) {
77
this.message = message;
88
this.routingKey = routingKey;
9-
this.metadata = metadata ?? [];
109
}
1110
}

0 commit comments

Comments
 (0)