(tag: string, payload: Buffer)
| 11 | import { Duplex, type DuplexOptions } from "node:stream" |
| 12 | |
| 13 | const backendMessage = (tag: string, payload: Buffer): Buffer => { |
| 14 | const length = Buffer.allocUnsafe(4) |
| 15 | length.writeInt32BE(payload.length + 4) |
| 16 | return Buffer.concat([Buffer.from(tag), length, payload]) |
| 17 | } |
| 18 | |
| 19 | const ready = Buffer.concat([ |
| 20 | backendMessage("R", Buffer.alloc(4)), |
no test coverage detected