From f6199e6334864c91baf59a404a8e5e14e43dc795 Mon Sep 17 00:00:00 2001 From: Zubeen Date: Wed, 4 Oct 2023 00:36:22 +0530 Subject: [PATCH 1/4] Changing expression check to option chain --- library/src/helpers/message.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/src/helpers/message.ts b/library/src/helpers/message.ts index 398700a8..3f0a12eb 100644 --- a/library/src/helpers/message.ts +++ b/library/src/helpers/message.ts @@ -84,8 +84,9 @@ export class MessageHelpers { } const headers = msg.headers(); - if (headers && headers.examples()) { - return headers.examples()?.map(example => ({ example })); + const examples = headers?.examples?.(); + if (examples) { + return examples.map(example => ({ example })); } return; From 9dbdbf87905c709f6e2ffaad472a5d2c121338b5 Mon Sep 17 00:00:00 2001 From: Zubeen Date: Wed, 4 Oct 2023 00:46:30 +0530 Subject: [PATCH 2/4] Removed redundant jump statement --- library/src/containers/AsyncApi/Standalone.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/library/src/containers/AsyncApi/Standalone.tsx b/library/src/containers/AsyncApi/Standalone.tsx index c9202727..4f5d72fb 100644 --- a/library/src/containers/AsyncApi/Standalone.tsx +++ b/library/src/containers/AsyncApi/Standalone.tsx @@ -32,7 +32,6 @@ class AsyncApiComponent extends Component { if (parsedSpec) { this.state = { asyncapi: parsedSpec }; } - return; } async componentDidMount() { From 0a6dfaf1acc0d33779afb4704d488bcbf06228c2 Mon Sep 17 00:00:00 2001 From: Zubeen Date: Sun, 15 Oct 2023 23:55:50 +0530 Subject: [PATCH 3/4] Fix indentation issues --- library/src/helpers/message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/helpers/message.ts b/library/src/helpers/message.ts index 3f0a12eb..ba100c9f 100644 --- a/library/src/helpers/message.ts +++ b/library/src/helpers/message.ts @@ -86,7 +86,7 @@ export class MessageHelpers { const headers = msg.headers(); const examples = headers?.examples?.(); if (examples) { - return examples.map(example => ({ example })); + return examples.map(example => ({ example })); } return; From 8dd89851e464abf10c9bfcd0a92c654bd083698f Mon Sep 17 00:00:00 2001 From: Zubeen Date: Sun, 15 Oct 2023 23:57:59 +0530 Subject: [PATCH 4/4] revert changes --- library/src/containers/AsyncApi/Standalone.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/library/src/containers/AsyncApi/Standalone.tsx b/library/src/containers/AsyncApi/Standalone.tsx index 4f5d72fb..c9202727 100644 --- a/library/src/containers/AsyncApi/Standalone.tsx +++ b/library/src/containers/AsyncApi/Standalone.tsx @@ -32,6 +32,7 @@ class AsyncApiComponent extends Component { if (parsedSpec) { this.state = { asyncapi: parsedSpec }; } + return; } async componentDidMount() {