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

use dockers for tests, use npm workspaces, add rejson & redisearch modules, fix some bugs

This commit is contained in:
leibale
2021-11-08 19:21:15 -05:00
parent ecbd5b6968
commit 3eb99dbe83
689 changed files with 5321 additions and 1712 deletions

View File

@@ -0,0 +1,46 @@
import { pushVerdictArguments } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export interface XClaimOptions {
IDLE?: number;
TIME?: number | Date;
RETRYCOUNT?: number;
FORCE?: true;
}
export function transformArguments(
key: string,
group: string,
consumer: string,
minIdleTime: number,
id: string | Array<string>,
options?: XClaimOptions
): Array<string> {
const args = ['XCLAIM', key, group, consumer, minIdleTime.toString()];
pushVerdictArguments(args, id);
if (options?.IDLE) {
args.push('IDLE', options.IDLE.toString());
}
if (options?.TIME) {
args.push(
'TIME',
(typeof options.TIME === 'number' ? options.TIME : options.TIME.getTime()).toString()
);
}
if (options?.RETRYCOUNT) {
args.push('RETRYCOUNT', options.RETRYCOUNT.toString());
}
if (options?.FORCE) {
args.push('FORCE');
}
return args;
}
export { transformReplyStreamMessages as transformReply } from './generic-transformers';