(node *Node)
| 1673 | } |
| 1674 | |
| 1675 | func IsModuleAugmentationExternal(node *Node) bool { |
| 1676 | // external module augmentation is a ambient module declaration that is either: |
| 1677 | // - defined in the top level scope and source file is an external module |
| 1678 | // - defined inside ambient module declaration located in the top level scope and source file not an external module |
| 1679 | switch node.Parent.Kind { |
| 1680 | case KindSourceFile: |
| 1681 | return IsExternalModule(node.Parent.AsSourceFile()) |
| 1682 | case KindModuleBlock: |
| 1683 | grandParent := node.Parent.Parent |
| 1684 | return IsAmbientModule(grandParent) && IsSourceFile(grandParent.Parent) && !IsExternalModule(grandParent.Parent.AsSourceFile()) |
| 1685 | } |
| 1686 | return false |
| 1687 | } |
| 1688 | |
| 1689 | func IsModuleWithStringLiteralName(node *Node) bool { |
| 1690 | return IsModuleDeclaration(node) && node.Name().Kind == KindStringLiteral |
no test coverage detected