From 49172207bf86429b846737bdadfeaba2acf4c585 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Fri, 4 Mar 2016 18:45:42 -0500 Subject: [PATCH] Expose ts.isExternalModule as public API. Fixes #7359 --- src/compiler/parser.ts | 4 ++++ src/compiler/utilities.ts | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 0a31c1bdebb..ada8e53ffb7 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -407,6 +407,10 @@ namespace ts { return result; } + export function isExternalModule(file: SourceFile): boolean { + return file.externalModuleIndicator !== undefined; + } + // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter // indicates what changed between the 'text' that this SourceFile has and the 'newText'. // The SourceFile will be created with the compiler attempting to reuse as many nodes from diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 9c598da9069..3916d0022c8 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -407,10 +407,6 @@ namespace ts { return createTextSpanFromBounds(pos, errorNode.end); } - export function isExternalModule(file: SourceFile): boolean { - return file.externalModuleIndicator !== undefined; - } - export function isExternalOrCommonJsModule(file: SourceFile): boolean { return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined; }