(message)
| 20 | } |
| 21 | |
| 22 | function encode(message) { |
| 23 | const json = JSON.stringify(message) |
| 24 | const header = `Content-Length: ${Buffer.byteLength(json, "utf8")}\r\n\r\n` |
| 25 | return Buffer.concat([Buffer.from(header, "utf8"), Buffer.from(json, "utf8")]) |
| 26 | } |
| 27 | |
| 28 | function decodeFrames(buffer) { |
| 29 | const results = [] |
no test coverage detected