Skip to content

Commit fd873e3

Browse files
committed
fix: explicitly set type to string[] for compiled tags returned from LogMessage
1 parent b1a280e commit fd873e3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/LogMessage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface ILogMessage {
1818
set message(msg: Message);
1919
get meta(): GenericRecord;
2020
set meta(obj: GenericRecord);
21-
get tags(): Tag[];
21+
get tags(): string[];
2222
set tags(tags: Tag[]);
2323
get value(): GenericRecord;
2424
get log(): GenericRecord;
@@ -150,9 +150,9 @@ export default class LogMessage implements ILogMessage {
150150
* Array of tags attached to this log. Includes global tags.
151151
* @returns {Tag[]} The tags attached to this log.
152152
*/
153-
get tags() {
153+
get tags(): string[] {
154154
const { __opts, __tags } = this;
155-
let tags: Tag[] = [...__tags];
155+
let tags = [...__tags];
156156

157157
if(Array.isArray(__opts.tags)) {
158158
tags = [...__opts.tags, ...tags];
@@ -177,7 +177,7 @@ export default class LogMessage implements ILogMessage {
177177
}
178178

179179
return tag;
180-
}).filter(tag => typeof tag === 'string' && tag);
180+
}).filter(tag => typeof tag === 'string' && tag) as string[];
181181
}
182182

183183
/**

0 commit comments

Comments
 (0)