Skip to content

Commit

Permalink
fix: explicitly set type to string[] for compiled tags returned fro…
Browse files Browse the repository at this point in the history
…m LogMessage
  • Loading branch information
KyleRoss committed Dec 10, 2021
1 parent b1a280e commit fd873e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/LogMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ILogMessage {
set message(msg: Message);
get meta(): GenericRecord;
set meta(obj: GenericRecord);
get tags(): Tag[];
get tags(): string[];
set tags(tags: Tag[]);
get value(): GenericRecord;
get log(): GenericRecord;
Expand Down Expand Up @@ -150,9 +150,9 @@ export default class LogMessage implements ILogMessage {
* Array of tags attached to this log. Includes global tags.
* @returns {Tag[]} The tags attached to this log.
*/
get tags() {
get tags(): string[] {
const { __opts, __tags } = this;
let tags: Tag[] = [...__tags];
let tags = [...__tags];

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

return tag;
}).filter(tag => typeof tag === 'string' && tag);
}).filter(tag => typeof tag === 'string' && tag) as string[];
}

/**
Expand Down

0 comments on commit fd873e3

Please sign in to comment.