MCPcopy
hub / github.com/redis/node-redis / transformReplies

Method transformReplies

packages/client/lib/multi-command.ts:62–76  ·  view source on GitHub ↗
(rawReplies: Array<unknown>)

Source from the content-addressed store, hash-verified

60 }
61
62 transformReplies(rawReplies: Array<unknown>): Array<unknown> {
63 const errorIndexes: Array<number> = [],
64 replies = rawReplies.map((reply, i) => {
65 if (reply instanceof ErrorReply) {
66 errorIndexes.push(i);
67 return reply;
68 }
69
70 const { transformReply, args } = this.queue[i];
71 return transformReply ? transformReply(reply, args.preserve, this.typeMapping) : reply;
72 });
73
74 if (errorIndexes.length) throw new MultiErrorReply(replies, errorIndexes);
75 return replies;
76 }
77}

Callers 8

execMethod · 0.80
execMethod · 0.80
execAsPipelineMethod · 0.80
execMethod · 0.80
execAsPipelineMethod · 0.80
execMethod · 0.80
execAsPipelineMethod · 0.80

Calls 2

transformReplyFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected