You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
25 lines
627 B
TypeScript
25 lines
627 B
TypeScript
import { RedisArgument, Command } from '@redis/client/dist/lib/RESP/types';
|
|
import { transformArrayDoubleReply } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
|
|
export function transformByRankArguments(
|
|
command: RedisArgument,
|
|
key: RedisArgument,
|
|
ranks: Array<number>
|
|
) {
|
|
const args = [command, key];
|
|
|
|
for (const rank of ranks) {
|
|
args.push(rank.toString());
|
|
}
|
|
|
|
return args;
|
|
}
|
|
|
|
export default {
|
|
FIRST_KEY_INDEX: 1,
|
|
IS_READ_ONLY: true,
|
|
transformArguments: transformByRankArguments.bind(undefined, 'TDIGEST.BYRANK'),
|
|
transformReply: transformArrayDoubleReply
|
|
} as const satisfies Command;
|
|
|