1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-03 04:01:40 +03:00
Files
node-redis/packages/client/lib/commands/BITCOUNT.ts
Leibale Eidelman 33a3f3f6c6 run tests with redis 7 as well - copied from #2020 (#2062)
* run tests on redis 7 as well - copied from #2020

* copy some changes from #2020

* clean BITCOUNT
2022-03-30 08:12:21 -04:00

34 lines
650 B
TypeScript

import { RedisCommandArgument, RedisCommandArguments } from '.';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
interface BitCountRange {
start: number;
end: number;
mode?: 'BYTE' | 'BIT';
}
export function transformArguments(
key: RedisCommandArgument,
range?: BitCountRange
): RedisCommandArguments {
const args = ['BITCOUNT', key];
if (range) {
args.push(
range.start.toString(),
range.end.toString()
);
if (range.mode) {
args.push(range.mode);
}
}
return args;
}
export declare function transformReply(): number;