Skip to content

Commit

Permalink
typefix: check type in findProp
Browse files Browse the repository at this point in the history
  • Loading branch information
mistlog committed Mar 11, 2021
1 parent 5a2c823 commit 2767125
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/statement/for-in-statement.tsx
Expand Up @@ -13,7 +13,7 @@ export interface ITypeForInStatement {
}

function findProp(obj: IObjectTypeLiteral, name: string) {
return obj.props.find(prop => prop.kind === "TypeObjectProperty" && prop.name.name === name) as ITypeObjectProperty;
return obj.props.find(prop => prop.kind === "TypeObjectProperty" && prop.name.kind === "Identifier" && prop.name.name === name) as ITypeObjectProperty;
}

export function TypeForInStatement() {
Expand Down

0 comments on commit 2767125

Please sign in to comment.