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

Method createTopLevel

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

Source from the content-addressed store, hash-verified

172 }
173
174 createTopLevel(): unknown {
175 const sectionLengths: Array<string | number> = [];
176 for (const s of this.bundleBuilder.sectionLengths) {
177 sectionLengths.push(s.name, s.length);
178 }
179 return [
180 byteString('🌐📦'),
181 byteString(`${formatVersion}\0\0`),
182 this.primaryURL,
183 cborg.encode(sectionLengths),
184 this.bundleBuilder.sections,
185 new Uint8Array(8), // Length (to be filled in later)
186 ];
187 }
188 })(this);
189 } else {
190 // format version b2

Callers

nothing calls this directly

Calls 1

byteStringFunction · 0.85

Tested by

no test coverage detected