UNPKG

@cuba-platform/front-generator

Version:
18 lines 655 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderTSNodes = void 0; const ts = require("typescript"); function renderTSNodes(nodes, separator = '\n') { const resultFile = ts.createSourceFile('temp.ts', '', ts.ScriptTarget.Latest, false, ts.ScriptKind.TS); const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed, }); // todo VM let content = ''; nodes.forEach(node => { content += printer.printNode(ts.EmitHint.Unspecified, node, resultFile) + separator; }); return content; } exports.renderTSNodes = renderTSNodes; //# sourceMappingURL=ts-helpers.js.map