Skip to content

Commit

Permalink
Merge pull request #18710 from ProjektGopher/fix/vue-client-extractAr…
Browse files Browse the repository at this point in the history
…gTypes

[bugfix] Check for undefined before reading property in extractArgTypes.ts
  • Loading branch information
ndelangen committed Aug 3, 2022
2 parents 4ee407b + 2f18165 commit c155a5c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/renderers/vue/src/docs/extractArgTypes.ts
Expand Up @@ -11,9 +11,11 @@ const SECTIONS = ['props', 'events', 'slots', 'methods'];
function isEnum(propDef: PropDef, docgenInfo: DocgenInfo): false | PropDef {
// cast as any, since "values" doesn't exist in DocgenInfo type
const { type, values } = docgenInfo as any;
const matched = Array.isArray(values) && values.length && type.name !== 'enum';
const matched = Array.isArray(values) && values.length && type?.name !== 'enum';

if (!matched) return false;
if (!matched) {
return false;
}

const enumString = values.join(', ');
let { summary } = propDef.type;
Expand Down

0 comments on commit c155a5c

Please sign in to comment.