1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00
Files
Leibale 5bd6141b22 wip
2023-07-06 12:10:03 -04:00

25 lines
627 B
TypeScript

import { RedisArgument, Command } from '@redis/client/dist/lib/RESP/types';
import { transformDoubleArrayReply } 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: transformDoubleArrayReply
} as const satisfies Command;