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