You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* Support BIT|BYTE option * clean code * clean code * clean code Co-authored-by: leibale <leibale1998@gmail.com>
33 lines
691 B
TypeScript
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;
|