()
| 40 | } |
| 41 | |
| 42 | createBundle(): Uint8Array { |
| 43 | this.compatAdapter.onCreateBundle(); |
| 44 | |
| 45 | this.addSection('index', this.fixupIndex()); |
| 46 | this.addSection('responses', this.responses); |
| 47 | |
| 48 | const wbn = cborg.encode(this.createTopLevel()); |
| 49 | |
| 50 | // Fill in the length field. |
| 51 | const view = new DataView(wbn.buffer, wbn.byteOffset + wbn.length - 8); |
| 52 | view.setUint32(0, Math.floor(wbn.length / 0x100000000)); |
| 53 | view.setUint32(4, wbn.length & 0xffffffff); |
| 54 | return wbn; |
| 55 | } |
| 56 | |
| 57 | addExchange( |
| 58 | url: string, |
no test coverage detected