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

@@ -155,6 +155,7 @@ import * as XRANGE from '../commands/XRANGE';
import * as XREAD from '../commands/XREAD';
import * as XREADGROUP from '../commands/XREADGROUP';
import * as XREVRANGE from '../commands/XREVRANGE';
import * as XSETID from '../commands/XSETID';
import * as XTRIM from '../commands/XTRIM';
import * as ZADD from '../commands/ZADD';
import * as ZCARD from '../commands/ZCARD';
@@ -508,6 +509,8 @@ export default {
xReadGroup: XREADGROUP,
XREVRANGE,
xRevRange: XREVRANGE,
XSETID,
xSetId: XSETID,
XTRIM,
xTrim: XTRIM,
ZADD,

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';