UNPKG

igniteui-react-core

Version:
76 lines (75 loc) 2.71 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends, __read, __spreadArray } from "tslib"; import { Base, markType } from "./type"; import { StringBuilder } from "./StringBuilder"; import { stringReplace } from "./string"; import { trimStart } from "./stringExtended"; /** * @hidden */ var CodeGeneratingCodeWriter = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CodeGeneratingCodeWriter, _super); function CodeGeneratingCodeWriter(a) { var _this = _super.call(this) || this; _this.e = new StringBuilder(0); _this.c = 0; _this.b = true; _this.a = null; _this.a = a; return _this; } CodeGeneratingCodeWriter.prototype.h = function () { this.c++; }; CodeGeneratingCodeWriter.prototype.f = function () { this.c--; }; CodeGeneratingCodeWriter.prototype.j = function (a) { this.g(); this.e.l(a); }; CodeGeneratingCodeWriter.prototype.g = function () { if (this.b) { this.b = false; for (var a = 0; a < this.c; a++) { if (this.a.useSpacesForIndent) { for (var b = 0; b < this.a.indentSpaces; b++) { this.e.l(" "); } } else { this.e.l("\t"); } } } }; CodeGeneratingCodeWriter.prototype.l = function (a) { this.g(); this.e.u(a); this.b = true; }; CodeGeneratingCodeWriter.prototype.k = function (a) { var b = stringReplace(a, "\r\n", "\n").split('\n'); for (var d = 0; d < b.length; d++) { var c = b[d]; var e = trimStart.apply(void 0, __spreadArray([c], __read(['\r', '\n']), false)); this.l(e); } }; CodeGeneratingCodeWriter.prototype.i = function () { this.g(); this.e.t(); this.b = true; }; CodeGeneratingCodeWriter.prototype.toString = function () { return this.e.toString(); }; CodeGeneratingCodeWriter.$t = markType(CodeGeneratingCodeWriter, 'CodeGeneratingCodeWriter'); return CodeGeneratingCodeWriter; }(Base)); export { CodeGeneratingCodeWriter };