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

Method constructor

js/bundle/src/encoder.ts:244–254  ·  view source on GitHub ↗
(status: number, headers: Headers)

Source from the content-addressed store, hash-verified

242
243class HeaderMap extends Map<string, string> {
244 constructor(status: number, headers: Headers) {
245 super();
246 if (status < 100 || status > 999) {
247 throw new Error('Invalid status code');
248 }
249
250 this.set(':status', status.toString());
251 for (const key of Object.keys(headers)) {
252 this.set(key.toLowerCase(), headers[key]);
253 }
254 }
255
256 toCBOR(): Uint8Array {
257 // Convert keys and values to Uint8Array, as the CBOR representation of

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected