You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* Support COMMAND GETKEYSANDFLAGS * Update COMMAND_GETKEYSANDFLAGS.spec.ts remove '.only' * clean code Co-authored-by: leibale <leibale1998@gmail.com>
25 lines
608 B
TypeScript
25 lines
608 B
TypeScript
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
|
|
}));
|
|
}
|