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

Function IsAnyImportSyntax

internal/ast/utilities.go:1872–1874  ·  view source on GitHub ↗

Checks if the node is a genuine import declation. In particular the re-parsed KindJSImportDeclaration is explicitly excluded because the callers of this function are typically not prepared to handle it properly. For more permissive check, use IsImportNode.

(node *Node)

Source from the content-addressed store, hash-verified

1870// is explicitly excluded because the callers of this function are typically not prepared to handle it properly.
1871// For more permissive check, use IsImportNode.
1872func IsAnyImportSyntax(node *Node) bool {
1873 return NodeKindIs(node, KindImportDeclaration, KindImportEqualsDeclaration)
1874}
1875
1876func IsJsonSourceFile(file *SourceFile) bool {
1877 return file.ScriptKind == core.ScriptKindJSON

Callers 3

addNodeOutliningSpansMethod · 0.92
deleteDeclarationFunction · 0.92
IsImportNodeFunction · 0.85

Calls 1

NodeKindIsFunction · 0.85

Tested by

no test coverage detected