MCPcopy Create free account
hub / github.com/denoland/std / #decodeSequence

Method #decodeSequence

cbor/sequence_decoder_stream.ts:203–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201 }
202
203 async *#decodeSequence(): AsyncGenerator<CborStreamOutput> {
204 while (true) {
205 const value = await this.#read(1, false);
206 if (value == undefined) return;
207 // Since `value` is only 1 byte long, it will be of type `number`
208 const x = await this.#decode(arrayToNumber(value.buffer, true) as number);
209 if (x instanceof Array) {
210 yield x[0];
211 await x[1];
212 } else yield x;
213 }
214 }
215
216 #decode(
217 byte: number,

Callers 1

constructorMethod · 0.95

Calls 3

#readMethod · 0.95
#decodeMethod · 0.95
arrayToNumberFunction · 0.90

Tested by

no test coverage detected