(data: string)
| 84 | } |
| 85 | |
| 86 | private handleData(data: string) { |
| 87 | const d = data; |
| 88 | const lines = d.split(/\r\n/).filter((line) => line.trim() !== ""); |
| 89 | if (lines.length === 0) return; |
| 90 | |
| 91 | if (this.unfinishedLine) { |
| 92 | lines[0] = this.unfinishedLine + lines[0]; |
| 93 | this.unfinishedLine = undefined; |
| 94 | } |
| 95 | if (!d.endsWith("\r\n")) { |
| 96 | this.unfinishedLine = lines.pop(); |
| 97 | } |
| 98 | lines.forEach((line) => this.handleLine(line)); |
| 99 | } |
| 100 | |
| 101 | private async handleLine(line: string) { |
| 102 | let msg: { messageType: string; messageId: string; data?: any }; |
no test coverage detected