Skip to content

Commit

Permalink
fix SNC errors I introduced 😅
Browse files Browse the repository at this point in the history
  • Loading branch information
alicewriteswrongs committed Jan 17, 2024
1 parent 53a92bc commit 148e8cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/transformers/automatic-key-insertion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function addKeyAttr(
* @returns whether or not this node has the name 'key'
*/
function isKeyAttr(attr: ts.JsxAttributeLike): boolean {
return attr.name && attrNameToString(attr) === 'key';
return !!attr.name && attrNameToString(attr) === 'key';
}

/**
Expand All @@ -176,7 +176,7 @@ function isKeyAttr(attr: ts.JsxAttributeLike): boolean {
* @returns the attribute's name, formatted as a string
*/
function attrNameToString(attr: ts.JsxAttributeLike): string {
switch (attr.name.kind) {
switch (attr.name?.kind) {
case ts.SyntaxKind.Identifier:
case ts.SyntaxKind.PrivateIdentifier:
case ts.SyntaxKind.StringLiteral:
Expand Down

0 comments on commit 148e8cd

Please sign in to comment.