MCPcopy Create free account
hub / github.com/WICG/webpackage / toCBOR

Method toCBOR

js/bundle/src/encoder.ts:256–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

addResponseMethod · 0.80

Calls 1

byteStringFunction · 0.85

Tested by

no test coverage detected