Skip to content

Commit

Permalink
refactor: added optional chain expression
Browse files Browse the repository at this point in the history
  • Loading branch information
parasss19 committed Oct 5, 2023
1 parent e3a8088 commit 4a43de4
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 4a43de4

Please sign in to comment.