MCPcopy Create free account
hub / github.com/microsoft/typescript-go / NodeHasName

Function NodeHasName

internal/ast/utilities.go:2430–2440  ·  view source on GitHub ↗
(statement *Node, id *Node)

Source from the content-addressed store, hash-verified

2428}
2429
2430func NodeHasName(statement *Node, id *Node) bool {
2431 name := statement.Name()
2432 if name != nil {
2433 return IsIdentifier(name) && name.Text() == id.Text()
2434 }
2435 if IsVariableStatement(statement) {
2436 declarations := statement.AsVariableStatement().DeclarationList.AsVariableDeclarationList().Declarations.Nodes
2437 return core.Some(declarations, func(d *Node) bool { return NodeHasName(d, id) })
2438 }
2439 return false
2440}
2441
2442func IsInternalModuleImportEqualsDeclaration(node *Node) bool {
2443 return IsImportEqualsDeclaration(node) && node.AsImportEqualsDeclaration().ModuleReference.Kind != KindExternalModuleReference

Callers 1

Calls 7

SomeFunction · 0.92
IsIdentifierFunction · 0.85
IsVariableStatementFunction · 0.85
AsVariableStatementMethod · 0.80
NameMethod · 0.65
TextMethod · 0.65

Tested by

no test coverage detected