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

Method IsTypeOnly

internal/ast/ast.go:878–892  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

876}
877
878func (n *Node) IsTypeOnly() bool {
879 switch n.Kind {
880 case KindImportEqualsDeclaration:
881 return n.AsImportEqualsDeclaration().IsTypeOnly
882 case KindImportSpecifier:
883 return n.AsImportSpecifier().IsTypeOnly
884 case KindImportClause:
885 return n.AsImportClause().PhaseModifier == KindTypeKeyword
886 case KindExportDeclaration:
887 return n.AsExportDeclaration().IsTypeOnly
888 case KindExportSpecifier:
889 return n.AsExportSpecifier().IsTypeOnly
890 }
891 return false
892}
893
894// If updating this function, also update `hasComment`.
895func (n *Node) CommentList() *NodeList {

Calls 5

AsImportSpecifierMethod · 0.95
AsImportClauseMethod · 0.95
AsExportDeclarationMethod · 0.95
AsExportSpecifierMethod · 0.95

Tested by

no test coverage detected