(data: string)
| 99 | this.resultBuf = []; |
| 100 | } |
| 101 | private appendBuf(data: string) { |
| 102 | const res = this.leftChunk + data; |
| 103 | const list = res.split("\n"); |
| 104 | let counter = 0; |
| 105 | const lastBit = list[list.length - 1]; |
| 106 | if (lastBit !== "") { |
| 107 | this.leftChunk = list.pop() || ""; |
| 108 | } else { |
| 109 | this.leftChunk = ""; |
| 110 | } |
| 111 | this.resultBuf=this.resultBuf.concat(list); |
| 112 | // while (list.length) { |
| 113 | // let item = list.shift() || ""; |
| 114 | // if (item.length === 0 ) { |
| 115 | // continue; |
| 116 | // } |
| 117 | // // if (this.params.output !== "line") { |
| 118 | // // item = JSON.parse(item); |
| 119 | // // } |
| 120 | // this.resultBuf.push(item); |
| 121 | // counter++; |
| 122 | // } |
| 123 | // console.log("buf length",this.resultBuf.length); |
| 124 | } |
| 125 | |
| 126 | process(chunk: Buffer): Promise<ProcessLineResult[]> { |
| 127 | return new Promise((resolve, reject) => { |
no outgoing calls
no test coverage detected