UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

14 lines (13 loc) 673 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var nodeHandlers_1 = require("./nodeHandlers"); /** * Replaces a tree with a new one that should be identical other than positions. * @param currentSourceFile - Current source file. * @param replacementSourceFile - Replacement source file. */ function replaceTreeStraight(currentSourceFile, replacementSourceFile) { var straightReplacementNodeHandler = new nodeHandlers_1.StraightReplacementNodeHandler(currentSourceFile.global.compilerFactory); straightReplacementNodeHandler.handleNode(currentSourceFile, replacementSourceFile); } exports.replaceTreeStraight = replaceTreeStraight;