Skip to content

Commit

Permalink
Merge branch 'master' into if-else-correction
Browse files Browse the repository at this point in the history
  • Loading branch information
parasss19 authored Oct 12, 2023
2 parents 7c52717 + c54659d commit 2e6c783
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion library/src/containers/AsyncApi/Standalone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class AsyncApiComponent extends Component<AsyncApiProps, AsyncAPIState> {
if (parsedSpec) {
this.state = { asyncapi: parsedSpec };
}
return;
}

async componentDidMount() {
Expand Down
5 changes: 2 additions & 3 deletions library/src/containers/Servers/Security.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export const Security: React.FunctionComponent<Props> = ({

let renderedSecurities;
if (
!security ||
!security.length ||
!security?.length ||
!securitySchemes ||
!Object.keys(securitySchemes).length
) {
Expand Down Expand Up @@ -276,7 +275,7 @@ const SecurityItem: React.FunctionComponent<SecurityItemProps> = ({
</div>
)}

{securitySchema && securitySchema.hasDescription() && (
{securitySchema?.hasDescription() && (
<div>
<Markdown>{securitySchema.description()}</Markdown>
</div>
Expand Down
8 changes: 3 additions & 5 deletions library/src/helpers/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ export class MessageHelpers {
}

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

return;
}

Expand Down Expand Up @@ -84,10 +83,9 @@ export class MessageHelpers {
}

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

return;
return undefined;
}
}

0 comments on commit 2e6c783

Please sign in to comment.