Skip to content

Commit

Permalink
feat: generate properties empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Dec 16, 2024
1 parent 6664dea commit 3f7f145
Show file tree
Hide file tree
Showing 2 changed files with 466 additions and 467 deletions.
11 changes: 4 additions & 7 deletions src/lib/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ const visit = ({
const classEntry: DocEntry = {
...serializeClass({checker, symbol}),
methods: [],
properties: [],
...buildSource({
node,
...rest
Expand All @@ -270,13 +271,9 @@ const visit = ({
.map(omitFilename)
);

const properties = docEntries
.filter(({doc_type}) => doc_type === 'property')
.map(omitFilename);

if (properties.length > 0) {
classEntry.properties = [...(classEntry?.properties ?? []), ...properties];
}
classEntry.properties?.push(
...docEntries.filter(({doc_type}) => doc_type === 'property').map(omitFilename)
);
};

forEachChild(node, visitChild);
Expand Down
Loading

0 comments on commit 3f7f145

Please sign in to comment.