()
| 254 | } |
| 255 | |
| 256 | toCBOR(): Uint8Array { |
| 257 | // Convert keys and values to Uint8Array, as the CBOR representation of |
| 258 | // header map is {bytestring => bytestring}. |
| 259 | const m = new Map<Uint8Array, Uint8Array>(); |
| 260 | for (const [key, value] of this.entries()) { |
| 261 | m.set(byteString(key), byteString(value)); |
| 262 | } |
| 263 | return cborg.encode(m); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | // Throws an error if `urlString` is not a valid exchange URL, i.e. it must not |
no test coverage detected