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 authored and shilman committed Aug 17, 2022
1 parent 2655803 commit 5c4ec40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/vue/src/client/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 5c4ec40

Please sign in to comment.