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

fix #1906 - implement BITFIELD_RO (#1988)

* fix #1906 - implement BITFIELD_RO

* set bitfield_ro min version to 6.2
This commit is contained in:
Leibale Eidelman
2022-03-02 05:29:42 -05:00
committed by GitHub
parent ac7d50c731
commit 9180b91047
5 changed files with 74 additions and 16 deletions

View File

@@ -0,0 +1,26 @@
import { BitFieldGetOperation } from './BITFIELD';
export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
type BitFieldRoOperations = Array<
Omit<BitFieldGetOperation, 'operation'> &
Partial<Pick<BitFieldGetOperation, 'operation'>>
>;
export function transformArguments(key: string, operations: BitFieldRoOperations): Array<string> {
const args = ['BITFIELD_RO', key];
for (const operation of operations) {
args.push(
'GET',
operation.encoding,
operation.offset.toString()
);
}
return args;
}
export declare function transformReply(): Array<number | null>;