Skip to content

Commit

Permalink
fix(utils): only compare name to Identifier.name if not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Aug 8, 2019
1 parent 5473767 commit acebbf9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rules/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ const isIdentifier = <V extends string>(
node: TSESTree.Node,
name?: V,
): node is KnownIdentifier<V> =>
node.type === AST_NODE_TYPES.Identifier && node.name === name;
node.type === AST_NODE_TYPES.Identifier &&
(name === undefined || node.name === name);

export const isSupportedAccessor = <V extends string>(
node: TSESTree.Node,
Expand Down

0 comments on commit acebbf9

Please sign in to comment.