You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
* wip * close #2216 - add support for TDIGEST.MERGESTORE and make compression optional on TDIGEST.CREATE * fix some tdigest commands, use bloom edge docker * fix index.ts * 2.4-RC2 (v2.4.1) * fix some commands and tests * clean code
31 lines
833 B
TypeScript
31 lines
833 B
TypeScript
import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
|
|
import { pushVerdictArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
import { CompressionOption, pushCompressionArgument } from '.';
|
|
|
|
export const FIRST_KEY_INDEX = 1;
|
|
|
|
interface MergeOptions extends CompressionOption {
|
|
OVERRIDE?: boolean;
|
|
}
|
|
|
|
export function transformArguments(
|
|
destKey: RedisCommandArgument,
|
|
srcKeys: RedisCommandArgument | Array<RedisCommandArgument>,
|
|
options?: MergeOptions
|
|
): RedisCommandArguments {
|
|
const args = pushVerdictArgument(
|
|
['TDIGEST.MERGE', destKey],
|
|
srcKeys
|
|
);
|
|
|
|
pushCompressionArgument(args, options);
|
|
|
|
if (options?.OVERRIDE) {
|
|
args.push('OVERRIDE');
|
|
}
|
|
|
|
return args;
|
|
}
|
|
|
|
export declare function transformReply(): 'OK';
|