MCPcopy Index your code
hub / github.com/WICG/webpackage / createBundle

Method createBundle

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

Source from the content-addressed store, hash-verified

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,

Callers 6

mainFunction · 0.95
encoder_test.jsFile · 0.80
decoder_test.jsFile · 0.80
cli_test.jsFile · 0.80

Calls 4

addSectionMethod · 0.95
fixupIndexMethod · 0.95
createTopLevelMethod · 0.95
onCreateBundleMethod · 0.65

Tested by

no test coverage detected