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

Function parseCommand

packages/client/lib/commands/ARMSET.ts:13–30  ·  view source on GitHub ↗
(parser: CommandParser, key: RedisArgument, entries: ArMSetEntries)

Source from the content-addressed store, hash-verified

11
12export default {
13 parseCommand(parser: CommandParser, key: RedisArgument, entries: ArMSetEntries) {
14 parser.push('ARMSET');
15 parser.pushKey(key);
16
17 if (entries instanceof Map) {
18 for (const [index, value] of entries.entries()) {
19 parser.push(index.toString(), value);
20 }
21 } else if (Array.isArray(entries)) {
22 for (const [index, value] of entries) {
23 parser.push(index.toString(), value);
24 }
25 } else {
26 for (const index of Object.keys(entries)) {
27 parser.push(index, entries[index]);
28 }
29 }
30 },
31 transformReply: undefined as unknown as () => NumberReply
32} as const satisfies Command;

Callers

nothing calls this directly

Calls 4

pushKeyMethod · 0.80
keysMethod · 0.80
toStringMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected