(bytes: Uint8Array)
| 31 | }; |
| 32 | |
| 33 | const sideBand = (bytes: Uint8Array): Uint8Array => { |
| 34 | const chunks: Uint8Array[] = [pktLine("NAK\n")]; |
| 35 | for (let offset = 0; offset < bytes.length; offset += 60_000) { |
| 36 | const chunk = bytes.subarray(offset, offset + 60_000); |
| 37 | const payload = new Uint8Array(chunk.length + 1); |
| 38 | payload[0] = 1; |
| 39 | payload.set(chunk, 1); |
| 40 | chunks.push(pktLine(payload)); |
| 41 | } |
| 42 | chunks.push(FLUSH); |
| 43 | return concat(chunks); |
| 44 | }; |
| 45 | |
| 46 | const advertisement = (sha: string): Uint8Array => |
| 47 | concat([ |
no test coverage detected