DIX ember docs when description is missing for whatever reason

This commit is contained in:
Norbert de Langen 2020-03-04 20:48:47 +01:00
parent 6ba9b32221
commit 4cf39dec63
No known key found for this signature in database
GPG Key ID: 976651DA156C2825

View File

@ -26,5 +26,10 @@ export const extractProps = componentName => {
export const extractComponentDescription = componentName => {
const json = getJSONDoc();
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
if (!componentDoc) {
return '';
}
return componentDoc.attributes.description;
};