Skip to content

Commit

Permalink
refactor: add optional chain expressions (#812)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Gornicki <[email protected]>
  • Loading branch information
parasss19 and derberg authored Oct 7, 2023
1 parent eed3f36 commit 229aa2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/src/helpers/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class MessageHelpers {
}

const payload = msg.payload();
if (payload && payload.examples()) {
if (payload?.examples()) {
return payload.examples()?.map(example => ({ example }));
}

Expand Down Expand Up @@ -84,7 +84,7 @@ export class MessageHelpers {
}

const headers = msg.headers();
if (headers && headers.examples()) {
if (headers?.examples()) {
return headers.examples()?.map(example => ({ example }));
}

Expand Down

0 comments on commit 229aa2f

Please sign in to comment.