Skip to content

Commit 6e3121e

Browse files
author
Alexandre Stanislawski
committed
fix(documentationjs): deeper related types
1 parent 2606906 commit 6e3121e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docgen/plugins/documentationjs-data.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function mapConnectors(connectors, symbols, files) {
8080

8181
function mapWidgets(widgets, symbols, files) {
8282
return forEach(widgets, symbol => {
83-
console.log(symbol.name);
83+
// console.log(symbol.name);
8484
const fileName = `widgets/${symbol.name}.html`;
8585

8686
const symbolWithRelatedType = {
@@ -124,7 +124,12 @@ function findRelatedTypes(functionSymbol, symbols) {
124124
const isCustomType = currentTypeName && currentTypeName !== 'Object' && currentTypeName[0] === currentTypeName[0].toUpperCase();
125125
if (isCustomType) {
126126
const typeSymbol = find(symbols, {name: currentTypeName});
127-
types = [...types, typeSymbol];
127+
if(!typeSymbol) console.warn('Undefined type: ', currentTypeName);
128+
else {
129+
types = [...types, typeSymbol];
130+
// iterate over each property to get their types
131+
forEach(typeSymbol.properties, p => findParamsTypes(p));
132+
}
128133
}
129134
}
130135
};

0 commit comments

Comments
 (0)