summaryrefslogtreecommitdiff
path: root/tools/ts_library_builder/ast_util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ts_library_builder/ast_util.ts')
-rw-r--r--tools/ts_library_builder/ast_util.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/ts_library_builder/ast_util.ts b/tools/ts_library_builder/ast_util.ts
index 81fc45f0c..528036b99 100644
--- a/tools/ts_library_builder/ast_util.ts
+++ b/tools/ts_library_builder/ast_util.ts
@@ -58,6 +58,14 @@ export function addVariableDeclaration(
});
}
+/** Copy one source file to the end of another source file. */
+export function appendSourceFile(
+ sourceFile: SourceFile,
+ targetSourceFile: SourceFile
+): void {
+ targetSourceFile.addStatements(`\n${sourceFile.print()}`);
+}
+
/** Check diagnostics, and if any exist, exit the process */
export function checkDiagnostics(project: Project, onlyFor?: string[]) {
const program = project.getProgram();