You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Support COMMAND GETKEYSANDFLAGS (#2039)
* Support COMMAND GETKEYSANDFLAGS * Update COMMAND_GETKEYSANDFLAGS.spec.ts remove '.only' * clean code Co-authored-by: leibale <leibale1998@gmail.com>
This commit is contained in:
24
packages/client/lib/commands/COMMAND_GETKEYSANDFLAGS.ts
Normal file
24
packages/client/lib/commands/COMMAND_GETKEYSANDFLAGS.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(args: Array<RedisCommandArgument>): RedisCommandArguments {
|
||||
return ['COMMAND', 'GETKEYSANDFLAGS', ...args];
|
||||
}
|
||||
|
||||
type KeysAndFlagsRawReply = Array<[
|
||||
RedisCommandArgument,
|
||||
RedisCommandArguments
|
||||
]>;
|
||||
|
||||
type KeysAndFlagsReply = Array<{
|
||||
key: RedisCommandArgument;
|
||||
flags: RedisCommandArguments;
|
||||
}>;
|
||||
|
||||
export function transformReply(reply: KeysAndFlagsRawReply): KeysAndFlagsReply {
|
||||
return reply.map(([key, flags]) => ({
|
||||
key,
|
||||
flags
|
||||
}));
|
||||
}
|
Reference in New Issue
Block a user