MCPcopy Index your code
hub / github.com/redis/node-redis / #decodeBigNumber

Method #decodeBigNumber

packages/client/lib/RESP/decoder.ts:286–305  ·  view source on GitHub ↗
(type, chunk)

Source from the content-addressed store, hash-verified

284 }
285
286 #decodeBigNumber(type, chunk) {
287 if (type === String) {
288 return this.#decodeSimpleString(String, chunk);
289 }
290
291 switch (chunk[this.#cursor]) {
292 case ASCII['+']:
293 return this.#maybeDecodeBigNumberValue(false, chunk);
294
295 case ASCII['-']:
296 return this.#maybeDecodeBigNumberValue(true, chunk);
297
298 default:
299 return this.#decodeBigNumberValue(
300 false,
301 this.#decodeUnsingedBigNumber.bind(this, 0n),
302 chunk
303 );
304 }
305 }
306
307 #maybeDecodeBigNumberValue(isNegative, chunk) {
308 const cb = this.#decodeUnsingedBigNumber.bind(this, 0n);

Callers 2

#decodeTypeValueMethod · 0.95

Calls 3

#decodeSimpleStringMethod · 0.95
#decodeBigNumberValueMethod · 0.95

Tested by

no test coverage detected