Skip to content

Commit

Permalink
refactor(docs): fix DeepScan warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetanmaisse committed Jun 29, 2021
1 parent fd1957a commit 56d28eb
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions addons/docs/src/frameworks/web-components/custom-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,28 @@ interface Sections {
function mapData(data: TagItem[], category: string) {
return (
data &&
data.reduce((acc, item) => {
if (item?.kind === 'method') return acc;
data
.filter((item) => !!item)
.reduce((acc, item) => {
if (item.kind === 'method') return acc;

const type =
category === 'properties' ? { name: item?.type?.text || item.type } : { name: 'void' };
acc[item.name] = {
name: item.name,
required: false,
description: item.description,
type,
table: {
category,
type: { summary: item?.type?.text || item.type },
defaultValue: { summary: item.default !== undefined ? item.default : item.defaultValue },
},
};
return acc;
}, {} as ArgTypes)
const type =
category === 'properties' ? { name: item.type?.text || item.type } : { name: 'void' };
acc[item.name] = {
name: item.name,
required: false,
description: item.description,
type,
table: {
category,
type: { summary: item.type?.text || item.type },
defaultValue: {
summary: item.default !== undefined ? item.default : item.defaultValue,
},
},
};
return acc;
}, {} as ArgTypes)
);
}

Expand Down

0 comments on commit 56d28eb

Please sign in to comment.