igniteui-react-core
Version:
Ignite UI React Core.
74 lines (73 loc) • 2.32 kB
JavaScript
/*
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 { Base, markType } from "./type";
import { StringBuilder } from "./StringBuilder";
import { stringReplace } from "./string";
import { trimStart } from "./stringExtended";
/**
* @hidden
*/
export let CodeGeneratingCodeWriter = /*@__PURE__*/ (() => {
class CodeGeneratingCodeWriter extends Base {
constructor(a) {
super();
this.e = new StringBuilder(0);
this.c = 0;
this.b = true;
this.a = null;
this.a = a;
}
h() {
this.c++;
}
f() {
this.c--;
}
j(a) {
this.g();
this.e.l(a);
}
g() {
if (this.b) {
this.b = false;
for (let a = 0; a < this.c; a++) {
if (this.a.useSpacesForIndent) {
for (let b = 0; b < this.a.indentSpaces; b++) {
this.e.l(" ");
}
}
else {
this.e.l("\t");
}
}
}
}
l(a) {
this.g();
this.e.u(a);
this.b = true;
}
k(a) {
let b = stringReplace(a, "\r\n", "\n").split('\n');
for (let d = 0; d < b.length; d++) {
let c = b[d];
let e = trimStart(c, ...['\r', '\n']);
this.l(e);
}
}
i() {
this.g();
this.e.t();
this.b = true;
}
toString() {
return this.e.toString();
}
}
CodeGeneratingCodeWriter.$t = /*@__PURE__*/ markType(CodeGeneratingCodeWriter, 'CodeGeneratingCodeWriter');
return CodeGeneratingCodeWriter;
})();