Skip to content

Commit

Permalink
fix(documentationjs): deeper related types
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Stanislawski committed Apr 26, 2017
1 parent 2606906 commit 6e3121e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docgen/plugins/documentationjs-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function mapConnectors(connectors, symbols, files) {

function mapWidgets(widgets, symbols, files) {
return forEach(widgets, symbol => {
console.log(symbol.name);
// console.log(symbol.name);
const fileName = `widgets/${symbol.name}.html`;

const symbolWithRelatedType = {
Expand Down Expand Up @@ -124,7 +124,12 @@ function findRelatedTypes(functionSymbol, symbols) {
const isCustomType = currentTypeName && currentTypeName !== 'Object' && currentTypeName[0] === currentTypeName[0].toUpperCase();
if (isCustomType) {
const typeSymbol = find(symbols, {name: currentTypeName});
types = [...types, typeSymbol];
if(!typeSymbol) console.warn('Undefined type: ', currentTypeName);
else {
types = [...types, typeSymbol];
// iterate over each property to get their types
forEach(typeSymbol.properties, p => findParamsTypes(p));
}
}
}
};
Expand Down

0 comments on commit 6e3121e

Please sign in to comment.