Skip to content

Commit

Permalink
fix: handle case where typeAnnotation exists with null `typeAnnot…
Browse files Browse the repository at this point in the history
…ation` child property; fixes #1008
  • Loading branch information
brettz9 committed Mar 31, 2023
1 parent 0453fe6 commit d004f08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jsdocUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const getFunctionParameterNames = (
if ('typeAnnotation' in param || hasLeftTypeAnnotation) {
const typeAnnotation = hasLeftTypeAnnotation ? param.left.typeAnnotation : param.typeAnnotation;

if (typeAnnotation.typeAnnotation.type === 'TSTypeLiteral') {
if (typeAnnotation?.typeAnnotation?.type === 'TSTypeLiteral') {
const propertyNames = typeAnnotation.typeAnnotation.members.map((member) => {
return getPropertiesFromPropertySignature(member);
});
Expand Down

0 comments on commit d004f08

Please sign in to comment.