You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
0
packages/client/lib/commands/XSETID.spec.ts
Normal file
0
packages/client/lib/commands/XSETID.spec.ts
Normal file
28
packages/client/lib/commands/XSETID.ts
Normal file
28
packages/client/lib/commands/XSETID.ts
Normal 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';
|
Reference in New Issue
Block a user