MCPcopy
hub / github.com/exceljs/exceljs / write

Method write

lib/csv/line-buffer.js:20–38  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

18 // done: all lines emitted
19
20 write(chunk) {
21 // find line or lines in chunk and emit them if not corked
22 // or queue them if corked
23 const data = this.buffer ? this.buffer + chunk : chunk;
24 const lines = data.split(/\r?\n/g);
25
26 // save the last line
27 this.buffer = lines.pop();
28
29 lines.forEach(function(line) {
30 if (this.corked) {
31 this.queue.push(line);
32 } else {
33 this.emit('line', line);
34 }
35 });
36
37 return !this.corked;
38 }
39
40 cork() {
41 this.corked = true;

Callers

nothing calls this directly

Calls 4

popMethod · 0.80
emitMethod · 0.80
forEachMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected