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/BITPOS.ts
Avital Fine fe16dc0eae Support BIT|BYTE option (#2035)
* Support BIT|BYTE option

* clean code

* clean code

* clean code

Co-authored-by: leibale <leibale1998@gmail.com>
2022-03-24 11:00:08 -04:00

33 lines
691 B
TypeScript

import { RedisCommandArgument, RedisCommandArguments } from '.';
import { BitValue } from './generic-transformers';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
export function transformArguments(
key: RedisCommandArgument,
bit: BitValue,
start?: number,
end?: number,
mode?: 'BYTE' | 'BIT'
): RedisCommandArguments {
const args = ['BITPOS', key, bit.toString()];
if (typeof start === 'number') {
args.push(start.toString());
}
if (typeof end === 'number') {
args.push(end.toString());
}
if (mode) {
args.push(mode);
}
return args;
}
export declare function transformReply(): number;