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

Method constructor

js/bundle/src/decoder.ts:197–207  ·  view source on GitHub ↗
(responsesSectionItem: unknown[])

Source from the content-addressed store, hash-verified

195 body: Uint8Array;
196
197 constructor(responsesSectionItem: unknown[]) {
198 if (responsesSectionItem.length !== 2) {
199 throw new Error('Wrong response structure');
200 }
201 const { status, headers } = decodeResponseMap(
202 asBytestring(responsesSectionItem[0])
203 );
204 this.status = status;
205 this.headers = headers;
206 this.body = asBytestring(responsesSectionItem[1]);
207 }
208}
209
210function decodeResponseMap(cbor: Uint8Array): {

Callers

nothing calls this directly

Calls 2

decodeResponseMapFunction · 0.85
asBytestringFunction · 0.85

Tested by

no test coverage detected