MCPcopy
hub / github.com/redis/ioredis / transformReply

Method transformReply

lib/Command.ts:357–369  ·  view source on GitHub ↗

* Convert buffer/buffer[] to string/string[], * and apply reply transformer.

(
    result: Buffer | Buffer[]
  )

Source from the content-addressed store, hash-verified

355 * and apply reply transformer.
356 */
357 transformReply(
358 result: Buffer | Buffer[]
359 ): string | string[] | Buffer | Buffer[] {
360 if (this.replyEncoding) {
361 result = convertBufferToString(result, this.replyEncoding);
362 }
363 const transformer = Command._transformer.reply[this.name];
364 if (transformer) {
365 result = transformer(result);
366 }
367
368 return result;
369 }
370
371 /**
372 * Set the wait time before terminating the attempt to execute a command

Callers 2

_convertValueMethod · 0.95
fillResultMethod · 0.80

Calls 1

convertBufferToStringFunction · 0.90

Tested by

no test coverage detected