stryker
Version:
The extendable JavaScript mutation testing framework
25 lines • 844 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var os = require("os");
var DEFAULT_MAX_SIZE = 2048;
var StringBuilder = /** @class */ (function () {
function StringBuilder() {
this.currentLength = 0;
this.strings = [];
this.maxSize = DEFAULT_MAX_SIZE;
}
StringBuilder.prototype.append = function (str) {
this.strings.push(str);
this.currentLength += str.length;
while (this.currentLength > this.maxSize && this.strings.length > 1) {
var popped = this.strings.shift();
this.currentLength -= popped.length;
}
};
StringBuilder.prototype.toString = function () {
return this.strings.join(os.EOL);
};
return StringBuilder;
}());
exports.default = StringBuilder;
//# sourceMappingURL=StringBuilder.js.map
;