1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

fix #1976 - XSETID (#2104)

This commit is contained in:
Leibale Eidelman
2022-04-26 09:05:44 -04:00
committed by GitHub
parent 225524fabf
commit baf67fd87f
3 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import { RedisCommandArgument, RedisCommandArguments } from '.';
export const FIRST_KEY_INDEX = 1;
interface XSetIdOptions {
ENTRIESADDED?: number;
MAXDELETEDID?: RedisCommandArgument;
}
export function transformArguments(
key: RedisCommandArgument,
lastId: RedisCommandArgument,
options?: XSetIdOptions
): RedisCommandArguments {
const args = ['XSETID', key, lastId];
if (options?.ENTRIESADDED) {
args.push('ENTRIESADDED', options.ENTRIESADDED.toString());
}
if (options?.MAXDELETEDID) {
args.push('MAXDELETEDID', options.MAXDELETEDID);
}
return args;
}
export declare function transformReply(): 'OK';