Skip to content

Commit

Permalink
Merge pull request #303 from SimplyY/patch-1
Browse files Browse the repository at this point in the history
fix: fix when initializer is undefined
  • Loading branch information
pvasek authored Sep 25, 2020
2 parents 693f14b + d61c4d2 commit bf212b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,9 @@ export class Parser {

const defaultProps = possibleDefaultProps[0];
let initializer = (defaultProps as ts.PropertyDeclaration).initializer;
if (!initializer) {
return res;
}
let properties = (initializer as ts.ObjectLiteralExpression).properties;

while (ts.isIdentifier(initializer as ts.Identifier)) {
Expand Down

0 comments on commit bf212b8

Please sign in to comment.