MCPcopy Create free account
hub / github.com/denoland/std / convert

Method convert

cbor/sequence_decoder_stream.ts:399–420  ·  view source on GitHub ↗
(
      gen: AsyncGenerator<CborStreamOutput>,
    )

Source from the content-addressed store, hash-verified

397 aI: number,
398 ): Promise<[CborMapDecodedStream, lock: Promise<unknown>]> {
399 async function* convert(
400 gen: AsyncGenerator<CborStreamOutput>,
401 ): AsyncGenerator<CborMapStreamOutput> {
402 while (true) {
403 const key = await gen.next();
404 if (key.done) break;
405 if (typeof key.value !== "string") {
406 throw new TypeError(
407 "Cannot parse map key: Only text string map keys are supported",
408 );
409 }
410
411 const value = await gen.next();
412 if (value.done) {
413 throw new RangeError(
414 "Impossible State: readDefinite | readIndefinite should have thrown an error",
415 );
416 }
417
418 yield [key.value, value.value];
419 }
420 }
421
422 let releaseLock: ReleaseLock = () => {};
423 const lock = new Promise((x) => releaseLock = x);

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected