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

Method #decodeSeven

cbor/sequence_decoder_stream.ts:498–518  ·  view source on GitHub ↗
(aI: number)

Source from the content-addressed store, hash-verified

496 }
497
498 async #decodeSeven(aI: number): Promise<undefined | null | boolean | number> {
499 switch (aI) {
500 case 20:
501 return false;
502 case 21:
503 return true;
504 case 22:
505 return null;
506 case 23:
507 return undefined;
508 }
509 if (25 <= aI && aI <= 27) {
510 return arrayToNumber(
511 (await this.#read(2 ** (aI - 24), true)).buffer,
512 false,
513 );
514 }
515 throw new RangeError(
516 `Cannot decode value (0b111_${aI.toString(2).padStart(5, "0")})`,
517 );
518 }
519
520 /**
521 * The {@link ReadableStream<CborStreamOutput>} associated with the instance,

Callers 1

#decodeMethod · 0.95

Calls 3

#readMethod · 0.95
arrayToNumberFunction · 0.90
toStringMethod · 0.45

Tested by

no test coverage detected