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

Method addSection

js/bundle/src/encoder.ts:82–89  ·  view source on GitHub ↗
(name: string, content: CBORValue)

Source from the content-addressed store, hash-verified

80 }
81
82 private addSection(name: string, content: CBORValue) {
83 if (this.sectionLengths.some((s) => s.name === name)) {
84 throw new Error('Duplicated section: ' + name);
85 }
86 let length = encodedLength(content);
87 this.sectionLengths.push({ name, length });
88 this.sections.push(content);
89 }
90
91 // Adds a response to `this.response`, and returns its length in the
92 // responses section.

Callers 5

createBundleMethod · 0.95
setManifestURLMethod · 0.80
setPrimaryURLMethod · 0.80
decoder_test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected