(tag: string, payload: Buffer)
| 18 | } |
| 19 | |
| 20 | const backendMessage = (tag: string, payload: Buffer): Buffer => { |
| 21 | const length = Buffer.allocUnsafe(4) |
| 22 | length.writeInt32BE(payload.length + 4) |
| 23 | return Buffer.concat([Buffer.from(tag), length, payload]) |
| 24 | } |
| 25 | |
| 26 | const replyingWith = (message: Buffer) => () => { |
| 27 | const socket = new Duplex({ |
no test coverage detected