fix(addon-docs): correctly parse union types in Vue/TS

closes #11944
This commit is contained in:
Markus Siering 2020-08-20 10:21:32 +02:00
parent 735848f52e
commit c4f70cacb2
No known key found for this signature in database
GPG Key ID: 5B631255825514BA

View File

@ -33,9 +33,10 @@ export const extractComponentSectionArray = (docgenSection: any) => {
const typeSystem = getTypeSystem(docgenSection[0]);
const createPropDef = getPropDefFactory(typeSystem);
return docgenSection
.map((item: any) => extractProp(item.name, item, typeSystem, createPropDef))
.filter(Boolean);
return docgenSection.map((item: any) => {
const sanitizedItem = { ...item, value: item.elements };
return extractProp(sanitizedItem.name, sanitizedItem, typeSystem, createPropDef);
});
};
export const extractComponentSectionObject = (docgenSection: any) => {