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

Method #decodeOne

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

Source from the content-addressed store, hash-verified

252 }
253
254 async #decodeOne(aI: number): Promise<number | bigint> {
255 if (aI > 27) {
256 throw new RangeError(
257 `Cannot decode value (0b001_${aI.toString(2).padStart(5, "0")})`,
258 );
259 }
260 const x = await this.#decodeZero(aI);
261 return typeof x === "bigint" ? -x - 1n : -x - 1;
262 }
263
264 async #decodeTwo(
265 aI: number,

Callers 1

#decodeMethod · 0.95

Calls 2

#decodeZeroMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected