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

Method write

packages/client/lib/RESP/decoder.ts:71–96  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

69 }
70
71 write(chunk) {
72 if (this.#cursor >= chunk.length) {
73 this.#cursor -= chunk.length;
74 return;
75 }
76
77 if (this.#next) {
78 if (this.#next(chunk) || this.#cursor >= chunk.length) {
79 this.#cursor -= chunk.length;
80 return;
81 }
82 }
83
84 do {
85 const type = chunk[this.#cursor];
86 if (++this.#cursor === chunk.length) {
87 this.#next = this.#continueDecodeTypeValue.bind(this, type);
88 break;
89 }
90
91 if (this.#decodeTypeValue(type, chunk)) {
92 break;
93 }
94 } while (this.#cursor < chunk.length);
95 this.#cursor -= chunk.length;
96 }
97
98 #continueDecodeTypeValue(type, chunk) {
99 this.#next = undefined;

Callers 1

testFunction · 0.45

Calls 1

#decodeTypeValueMethod · 0.95

Tested by 1

testFunction · 0.36