1 | ;
|
2 |
|
3 | function StringWriter (config) {
|
4 | this.lines = [];
|
5 | this.lineSeparator = config.lineSeparator;
|
6 | }
|
7 |
|
8 | StringWriter.prototype.write = function (str) {
|
9 | this.lines.push(str);
|
10 | };
|
11 |
|
12 | StringWriter.prototype.flush = function () {
|
13 | var str = this.lines.join(this.lineSeparator);
|
14 | this.lines.length = 0;
|
15 | return str;
|
16 | };
|
17 |
|
18 | module.exports = StringWriter;
|