'use strict'; var chunkDVADLCYY_cjs = require('./chunk-DVADLCYY.cjs'); var ts = require('typescript'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var ts__default = /*#__PURE__*/_interopDefault(ts); var { factory } = ts__default.default; var escapeNewLines = (code) => code.replace(/\n\n/g, "\n/* :newline: */"); var restoreNewLines = (code) => code.replace(/\/\* :newline: \*\//g, "\n"); function print(elements, { source = "", baseName = "print.ts", removeComments, noEmitHelpers, newLine = ts__default.default.NewLineKind.LineFeed, scriptKind = ts__default.default.ScriptKind.TS } = {}) { const sourceFile = ts__default.default.createSourceFile(baseName, escapeNewLines(source), ts__default.default.ScriptTarget.ES2022, false, scriptKind); const printer = ts__default.default.createPrinter({ omitTrailingSemicolon: true, newLine, removeComments, noEmitHelpers }); let nodes = []; if (!elements) { return ""; } if (Array.isArray(elements)) { nodes = elements.filter(Boolean); } else { nodes = [elements].filter(Boolean); } const outputFile = printer.printList(ts__default.default.ListFormat.MultiLine, factory.createNodeArray(nodes), sourceFile); const outputSource = printer.printFile(sourceFile); return [outputFile, restoreNewLines(outputSource)].filter(Boolean).join("\n"); } // src/format.ts function format(source, options = {}) { return print([], { source, noEmitHelpers: false, ...options }); } Object.defineProperty(exports, "factory", { enumerable: true, get: function () { return chunkDVADLCYY_cjs.factory_exports; } }); exports.format = format; exports.print = print; //# sourceMappingURL=index.cjs.map //# sourceMappingURL=index.cjs.map