Merge pull request #22087 from amcasey/AmbientModuleImports

Organize imports in ambient modules
This commit is contained in:
Andrew Casey
2018-02-23 17:43:28 -08:00
committed by GitHub
5 changed files with 129 additions and 36 deletions
+2 -2
View File
@@ -425,8 +425,8 @@ namespace ts {
}
export function isAmbientModule(node: Node): boolean {
return node && node.kind === SyntaxKind.ModuleDeclaration &&
((<ModuleDeclaration>node).name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(<ModuleDeclaration>node));
return node && isModuleDeclaration(node) &&
(node.name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(node));
}
export function isModuleWithStringLiteralName(node: Node): node is ModuleDeclaration {