1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-03 04:01:40 +03:00
Files
node-redis/packages/client/lib/commands/SPOP_COUNT.ts
Nikolay Karadzhov 742d5713e8 fix(commands): sPopCount return Array<string> (#3006)
Also, touch the tests for spop and spopcount
to use the new parseCommand API

fixes #3004
2025-06-25 13:15:44 +03:00

21 lines
707 B
TypeScript

import { CommandParser } from '../client/parser';
import { RedisArgument, Command, ArrayReply } from '../RESP/types';
export default {
IS_READ_ONLY: false,
/**
* Constructs the SPOP command to remove and return multiple random members from a set
*
* @param parser - The command parser
* @param key - The key of the set to pop from
* @param count - The number of members to pop
* @see https://redis.io/commands/spop/
*/
parseCommand(parser: CommandParser, key: RedisArgument, count: number) {
parser.push('SPOP');
parser.pushKey(key);
parser.push(count.toString());
},
transformReply: undefined as unknown as () => ArrayReply<string>
} as const satisfies Command;