Skip to content

Commit cb825fd

Browse files
Add clarifying comment about pointer comparison in transformImportTypeNode
Co-authored-by: RyanCavanaugh <[email protected]>
1 parent 9f25af2 commit cb825fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/transformers/declarations/transform.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ func (tx *DeclarationTransformer) transformImportTypeNode(input *ast.ImportTypeN
573573
}
574574
specifier := tx.rewriteModuleSpecifier(input.AsNode(), input.Argument.AsLiteralTypeNode().Literal)
575575
var argument *ast.Node
576+
// Use pointer equality to check if the specifier changed - rewriteModuleSpecifier
577+
// returns the same node instance when no rewriting is needed
576578
if specifier == input.Argument.AsLiteralTypeNode().Literal {
577579
// No change to the specifier, reuse the original argument to avoid creating new nodes
578580
argument = input.Argument

0 commit comments

Comments
 (0)